Skip to content

Commit f880bf5

Browse files
authored
Update LoggedUser.php
1 parent 81f9640 commit f880bf5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

modules/go5auth/lib/Auth/Source/LoggedUser.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ public function authenticate(&$state)
3535
$userInfo = $this->getUserInfo($accessToken);
3636

3737
if ($userInfo->data->attributes->status != 'active') {
38-
throw new SimpleSAML_Error_Exception('go5auth | error: inactive user ' . $userInfo->data->id);
38+
header('HTTP/1.1 403 Forbidden');
39+
echo 'go5auth | error: inactive user';
40+
exit;
3941
}
4042

4143
$userAttributes = [
@@ -66,7 +68,9 @@ private function getUserInfo($token)
6668
return json_decode($userResponse->getBody()->getContents());
6769

6870
} catch (HttpClientException $e) {
69-
throw new SimpleSAML_Error_Exception('go5auth | error: ' . $e->getMessage());
71+
header('HTTP/1.1 401 Unauthorized');
72+
echo 'go5auth | error: invalid access_token';
73+
exit;
7074
}
7175
}
7276
}

0 commit comments

Comments
 (0)