mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-05 11:41:53 +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();
|
$request = (new Request)->createFromGlobals();
|
||||||
$server->setRequest($request);
|
$server->setRequest($request);
|
||||||
|
|
||||||
// GET /authorize
|
|
||||||
$router->get('/authorize', function (Request $request) use ($server) {
|
$router->get('/authorize', function (Request $request) use ($server) {
|
||||||
|
|
||||||
// First ensure the parameters in the query string are correct
|
// First ensure the parameters in the query string are correct
|
||||||
@ -74,15 +73,12 @@ $router->get('/authorize', function (Request $request) use ($server) {
|
|||||||
return $response;
|
return $response;
|
||||||
});
|
});
|
||||||
|
|
||||||
// /access_token
|
|
||||||
$router->post('/access_token', function (Request $request) use ($server) {
|
$router->post('/access_token', function (Request $request) use ($server) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$response = $server->issueAccessToken();
|
$response = $server->issueAccessToken();
|
||||||
return new Response(json_encode($response), 200, [
|
return new Response(json_encode($response), 200);
|
||||||
'Location' => $redirectUri
|
|
||||||
]);
|
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user