Skip to content

Commit

Permalink
Ensure state is in access denied redirect. Fixes #597
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbilbie committed Jun 28, 2016
1 parent 66de05a commit 5ee1583
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Grant/AuthCodeGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,12 @@ public function completeAuthorizationRequest(AuthorizationRequest $authorization
// The user denied the client, redirect them back with an error
throw OAuthServerException::accessDenied(
'The user denied the request',
$finalRedirectUri
$this->makeRedirectUri(
$finalRedirectUri,
[
'state' => $authorizationRequest->getState(),
]
)
);
}
}
7 changes: 6 additions & 1 deletion src/Grant/ImplicitGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,12 @@ public function completeAuthorizationRequest(AuthorizationRequest $authorization
// The user denied the client, redirect them back with an error
throw OAuthServerException::accessDenied(
'The user denied the request',
$finalRedirectUri
$this->makeRedirectUri(
$finalRedirectUri,
[
'state' => $authorizationRequest->getState(),
]
)
);
}
}

0 comments on commit 5ee1583

Please sign in to comment.