Skip to content

Commit

Permalink
Throw exceptions when checking the auth response
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Sep 26, 2017
1 parent 7848ebe commit 8ed97da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/OAuth/FortifiProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/**
Expand Down

0 comments on commit 8ed97da

Please sign in to comment.