Support Auth0.
[readifood.git] / www / login.php
1 <?php
2
3   $root = join(DIRECTORY_SEPARATOR, array($_SERVER['DOCUMENT_ROOT'], ".."));
4   $lib_root = join(DIRECTORY_SEPARATOR, array($root, "lib"));
5   require_once(join(DIRECTORY_SEPARATOR, array($root, "vendor", "autoload.php")));
6   include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "auth0.php")));
7
8   if (isset($_GET['code'])) {
9     try {
10       $auth0->getUser();
11       header("Location: https://" . $_SERVER['HTTP_HOST'] . "/");
12       exit;
13     }
14     catch (\Exception $e) {
15     }
16   }
17
18 ?>