From 8ed97dae38a313b3e89e052f142e45cd69ab515b Mon Sep 17 00:00:00 2001 From: Brooke Bryan Date: Tue, 26 Sep 2017 14:44:28 +0100 Subject: [PATCH] Throw exceptions when checking the auth response --- src/OAuth/FortifiProvider.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/OAuth/FortifiProvider.php b/src/OAuth/FortifiProvider.php index 1f7bb3b..a798a85 100644 --- a/src/OAuth/FortifiProvider.php +++ b/src/OAuth/FortifiProvider.php @@ -260,7 +260,11 @@ protected function getDefaultScopes() */ protected function checkResponse(ResponseInterface $response, $data) { - //error_log(print_r(['data' => $data, 'resp' => $response], true)); + if($response->getStatusCode() != 200) + { + $msg = Arrays::value($data, ['message'], 'An unknown error occurred'); + throw new IdentityProviderException($msg, $response->getStatusCode(), (array)$data); + } } /**