Code tidy

This commit is contained in:
Alex Bilbie 2016-04-18 12:12:06 +01:00
parent f8b2e80ef3
commit 51f44fdf17

View File

@ -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,7 +239,12 @@ class AuthCodeGrant extends AbstractAuthorizeGrant
$authorizationRequest->getScopes() $authorizationRequest->getScopes()
); );
$redirectPayload['code'] = $this->encrypt( $response = new RedirectResponse();
$response->setRedirectUri(
$this->makeRedirectUri(
$finalRedirectUri,
[
'code' => $this->encrypt(
json_encode( json_encode(
[ [
'client_id' => $authCode->getClient()->getIdentifier(), 'client_id' => $authCode->getClient()->getIdentifier(),
@ -245,14 +255,9 @@ class AuthCodeGrant extends AbstractAuthorizeGrant
'expire_time' => (new \DateTime())->add($this->authCodeTTL)->format('U'), 'expire_time' => (new \DateTime())->add($this->authCodeTTL)->format('U'),
] ]
) )
); ),
$redirectPayload['state'] = $authorizationRequest->getState(); 'state' => $authorizationRequest->getState(),
]
$response = new RedirectResponse();
$response->setRedirectUri(
$this->makeRedirectUri(
$finalRedirectUri,
$redirectPayload
) )
); );