Skip to content

Commit

Permalink
Merge pull request #1 from lukasmerk/patch-1
Browse files Browse the repository at this point in the history
Fix error detection
  • Loading branch information
greew authored Jan 3, 2024
2 parents 8eaaaf5 + b25e720 commit 025c9ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Provider/Azure.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected function checkResponse(ResponseInterface $response, $data)
{
if (isset($data['error'])) {
throw new IdentityProviderException(
(isset($data['error']['message']) ? $data['error']['message'] : $response->getReasonPhrase()),
(isset($data['error_description']) ? $data['error_description'] : $response->getReasonPhrase()),
$response->getStatusCode(),
(string)$response->getBody()
);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Provider/AzureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function testExceptionThrownWhenErrorObjectReceived(): void

$postResponse = m::mock('Psr\Http\Message\ResponseInterface');
$postResponse->shouldReceive('getBody')->andReturn(
'{"error": {"code": "request_token_expired", "message": "' . $message . '"}}'
'{"error": "request_token_expired", "error_description": "' . $message . '"}'
);
$postResponse->shouldReceive('getHeader')->andReturn(['content-type' => 'json']);
$postResponse->shouldReceive('getStatusCode')->andReturn(500);
Expand Down

0 comments on commit 025c9ca

Please sign in to comment.