From df2e0642e80d3f72034d8022773a2906c644abc4 Mon Sep 17 00:00:00 2001 From: Yaroslav Krutikov Date: Tue, 23 May 2023 08:57:37 +0200 Subject: [PATCH] FRW-1928 Fixed response code for OAuth token creation endpoint. (#4) FRW-1928 Fixed response code for OAuth token creation endpoint. --- phpstan.neon | 2 +- .../Controller/AuthorizeResourceController.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 85dede9..23c1e3d 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,5 @@ parameters: - level: 7 + level: 8 bootstrapFiles: - tests/bootstrap.php checkGenericClassInNonGenericObjectType: false diff --git a/src/SprykerEco/Glue/AuthorizationPickingAppBackendApi/Controller/AuthorizeResourceController.php b/src/SprykerEco/Glue/AuthorizationPickingAppBackendApi/Controller/AuthorizeResourceController.php index 911122e..6912e64 100644 --- a/src/SprykerEco/Glue/AuthorizationPickingAppBackendApi/Controller/AuthorizeResourceController.php +++ b/src/SprykerEco/Glue/AuthorizationPickingAppBackendApi/Controller/AuthorizeResourceController.php @@ -39,7 +39,12 @@ public function postAction( $oauthResponseTransfer = $this->getFactory()->getAuthorizationPickingAppBackendApiFacade()->authorize($oauthRequestTransfer); - return $this->mapAuthenticationAttributesToGlueResponseTransfer($oauthResponseTransfer); + $glueResponseTransfer = $this->mapAuthenticationAttributesToGlueResponseTransfer($oauthResponseTransfer); + if (!$glueResponseTransfer->getHttpStatus()) { + $glueResponseTransfer->setHttpStatus(Response::HTTP_OK); + } + + return $glueResponseTransfer; } /**