summaryrefslogtreecommitdiffstats
path: root/examples/broker/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'examples/broker/index.php')
-rw-r--r--examples/broker/index.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/broker/index.php b/examples/broker/index.php
index 4bdcc11..f062c43 100644
--- a/examples/broker/index.php
+++ b/examples/broker/index.php
@@ -9,7 +9,12 @@ if (isset($_GET['sso_error'])) {
$broker = new Jasny\SSO\Broker(getenv('SSO_SERVER'), getenv('SSO_BROKER_ID'), getenv('SSO_BROKER_SECRET'));
$broker->attach(true);
-$user = $broker->getUserInfo();
+try {
+ $user = $broker->getUserInfo();
+} catch (\Jasny\SSO\Exception $e) {
+ header("Location: error.php?sso_error=" . $e->getMessage(), true, 307);
+ exit;
+}
if (!$user) {
header("Location: login.php", true, 307);