mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-01 16:33:07 +05:30
Doc improvements
This commit is contained in:
parent
d02437dd73
commit
e08669d50c
@ -208,14 +208,16 @@ class AuthCodeGrant extends AbstractGrant
|
||||
);
|
||||
}
|
||||
|
||||
$stateParameter = $this->getQueryStringParameter('state', $request);
|
||||
|
||||
// The user has either approved or denied the client, so redirect them back
|
||||
$redirectUri = new Uri($client->getRedirectUri());
|
||||
parse_str($redirectUri->getQuery(), $redirectPayload);
|
||||
|
||||
$stateParameter = $this->getQueryStringParameter('state', $request);
|
||||
if ($stateParameter !== null) {
|
||||
$redirectPayload['state'] = $stateParameter;
|
||||
}
|
||||
|
||||
// THe user approved the client, redirect them back with an auth code
|
||||
if ($userHasApprovedClient === true) {
|
||||
$authCode = $this->issueAuthCode(
|
||||
$this->authCodeTTL,
|
||||
@ -242,6 +244,7 @@ class AuthCodeGrant extends AbstractGrant
|
||||
return new Response\RedirectResponse($redirectUri->withQuery(http_build_query($redirectPayload)));
|
||||
}
|
||||
|
||||
// The user denied the client, redirect them back with an error
|
||||
$exception = OAuthServerException::accessDenied('The user denied the request', (string) $redirectUri);
|
||||
|
||||
return $exception->generateHttpResponse();
|
||||
|
Loading…
Reference in New Issue
Block a user