RVRNEXT-2 token endpoint should be POST
All checks were successful
rvr-nextgen/pipeline/pr-master This commit looks good

This commit is contained in:
Bence Pőcze 2023-04-08 19:36:05 +02:00
parent 74d0b24f5f
commit 1200489186
Signed by: bence
GPG Key ID: DC5BD6E95A333E6D
2 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ class OAuthLoginController
{ {
$oAuthTokenRepository = new OAuthTokenRepository(); $oAuthTokenRepository = new OAuthTokenRepository();
$userRepository = new UserRepository(); $userRepository = new UserRepository();
$token = $oAuthTokenRepository->getByCode($this->request->query('code')); $token = $oAuthTokenRepository->getByCode($this->request->post('code'));
if ($token === null || $token->getExpiresDate() < new DateTime()) { if ($token === null || $token->getExpiresDate() < new DateTime()) {
return new JsonContent([ return new JsonContent([

View File

@ -23,7 +23,7 @@ Container::$routeCollection->group('login', function (SokoWeb\Routing\RouteColle
Container::$routeCollection->group('oauth', function (SokoWeb\Routing\RouteCollection $routeCollection) { Container::$routeCollection->group('oauth', function (SokoWeb\Routing\RouteCollection $routeCollection) {
$routeCollection->get('oauth-start', 'start', [RVR\Controller\OAuthLoginController::class, 'startOauth']); $routeCollection->get('oauth-start', 'start', [RVR\Controller\OAuthLoginController::class, 'startOauth']);
$routeCollection->get('oauth-finish', 'finish', [RVR\Controller\OAuthLoginController::class, 'finishOauth']); $routeCollection->get('oauth-finish', 'finish', [RVR\Controller\OAuthLoginController::class, 'finishOauth']);
$routeCollection->get('oauth-token', 'token', [RVR\Controller\OAuthLoginController::class, 'getToken']); $routeCollection->post('oauth-token', 'token', [RVR\Controller\OAuthLoginController::class, 'getToken']);
$routeCollection->get('oauth-jwtPublicKey', 'jwtPublicKey', [RVR\Controller\OAuthLoginController::class, 'getJwtPublicKey']); $routeCollection->get('oauth-jwtPublicKey', 'jwtPublicKey', [RVR\Controller\OAuthLoginController::class, 'getJwtPublicKey']);
}); });
Container::$routeCollection->group('password', function (SokoWeb\Routing\RouteCollection $routeCollection) { Container::$routeCollection->group('password', function (SokoWeb\Routing\RouteCollection $routeCollection) {