mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-16 18:19:47 +05:30
Renamed auth.php to authcode_grant.php
This commit is contained in:
parent
443d72ee24
commit
5ec1bf8a88
@ -33,7 +33,6 @@ $server->addGrantType($authCodeGrant);
|
||||
$request = (new Request)->createFromGlobals();
|
||||
$server->setRequest($request);
|
||||
|
||||
// GET /authorize
|
||||
$router->get('/authorize', function (Request $request) use ($server) {
|
||||
|
||||
// First ensure the parameters in the query string are correct
|
||||
@ -74,15 +73,12 @@ $router->get('/authorize', function (Request $request) use ($server) {
|
||||
return $response;
|
||||
});
|
||||
|
||||
// /access_token
|
||||
$router->post('/access_token', function (Request $request) use ($server) {
|
||||
|
||||
try {
|
||||
|
||||
$response = $server->issueAccessToken();
|
||||
return new Response(json_encode($response), 200, [
|
||||
'Location' => $redirectUri
|
||||
]);
|
||||
return new Response(json_encode($response), 200);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
Loading…
Reference in New Issue
Block a user