Skip to content

Commit

Permalink
Merge pull request #11 from fortifi/auth-exception
Browse files Browse the repository at this point in the history
Throw exceptions when checking the auth response
  • Loading branch information
rgooding committed Sep 26, 2017
2 parents 7848ebe + 8ed97da commit 3864e22
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 3864e22

Please sign in to comment.