X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;ds=sidebyside;f=www%2Findex.php;fp=www%2Findex.php;h=d65e7c7c6efb13745a7d3bbaae59e7e9ab7ea254;hb=ae839ebaa4e1e0ae4cee28c16cc0bc7a0368f4af;hp=d88b3217651b2da70cb14326f55fb2658a026dbd;hpb=ea0e53db8b5a264b6e231038815d2c350076d02a;p=readifood.git diff --git a/www/index.php b/www/index.php index d88b321..d65e7c7 100644 --- a/www/index.php +++ b/www/index.php @@ -34,6 +34,21 @@ include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "functions.php"))); include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "session.php"))); + if (isset($_GET['code'])) { + try { + $auth0->getUser(); + header("Location: https://" . $_SERVER['HTTP_HOST'] . "/"); + exit; + } + catch (\Exception $e) { + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "header.php"))); + echo "

$charity

\n"; + echo "

Not logged in!

\n"; + echo "

There was an authentication error.

\n"; + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "footer.php"))); + } + } + $auth0_user = $auth0->getUser(); if (isset($auth0_user)) $username = $auth0_user["sub"]; else $username = null;