mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-26 06:59:49 +05:30
Code tidy
This commit is contained in:
parent
f8b2e80ef3
commit
51f44fdf17
@ -108,7 +108,12 @@ class AuthCodeGrant extends AbstractAuthorizeGrant
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Finalize the requested scopes
|
// Finalize the requested scopes
|
||||||
$scopes = $this->scopeRepository->finalizeScopes($scopes, $this->getIdentifier(), $client, $authCodePayload->user_id);
|
$scopes = $this->scopeRepository->finalizeScopes(
|
||||||
|
$scopes,
|
||||||
|
$this->getIdentifier(),
|
||||||
|
$client,
|
||||||
|
$authCodePayload->user_id
|
||||||
|
);
|
||||||
} catch (\LogicException $e) {
|
} catch (\LogicException $e) {
|
||||||
throw OAuthServerException::invalidRequest('code', 'Cannot decrypt the authorization code');
|
throw OAuthServerException::invalidRequest('code', 'Cannot decrypt the authorization code');
|
||||||
}
|
}
|
||||||
@ -234,25 +239,25 @@ class AuthCodeGrant extends AbstractAuthorizeGrant
|
|||||||
$authorizationRequest->getScopes()
|
$authorizationRequest->getScopes()
|
||||||
);
|
);
|
||||||
|
|
||||||
$redirectPayload['code'] = $this->encrypt(
|
|
||||||
json_encode(
|
|
||||||
[
|
|
||||||
'client_id' => $authCode->getClient()->getIdentifier(),
|
|
||||||
'redirect_uri' => $authCode->getRedirectUri(),
|
|
||||||
'auth_code_id' => $authCode->getIdentifier(),
|
|
||||||
'scopes' => $authCode->getScopes(),
|
|
||||||
'user_id' => $authCode->getUserIdentifier(),
|
|
||||||
'expire_time' => (new \DateTime())->add($this->authCodeTTL)->format('U'),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$redirectPayload['state'] = $authorizationRequest->getState();
|
|
||||||
|
|
||||||
$response = new RedirectResponse();
|
$response = new RedirectResponse();
|
||||||
$response->setRedirectUri(
|
$response->setRedirectUri(
|
||||||
$this->makeRedirectUri(
|
$this->makeRedirectUri(
|
||||||
$finalRedirectUri,
|
$finalRedirectUri,
|
||||||
$redirectPayload
|
[
|
||||||
|
'code' => $this->encrypt(
|
||||||
|
json_encode(
|
||||||
|
[
|
||||||
|
'client_id' => $authCode->getClient()->getIdentifier(),
|
||||||
|
'redirect_uri' => $authCode->getRedirectUri(),
|
||||||
|
'auth_code_id' => $authCode->getIdentifier(),
|
||||||
|
'scopes' => $authCode->getScopes(),
|
||||||
|
'user_id' => $authCode->getUserIdentifier(),
|
||||||
|
'expire_time' => (new \DateTime())->add($this->authCodeTTL)->format('U'),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'state' => $authorizationRequest->getState(),
|
||||||
|
]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user