diff --git a/src/Handler/Admin/Cache/DeleteHandler.php b/src/Handler/Admin/Cache/DeleteHandler.php index f95bc52..3cecadc 100644 --- a/src/Handler/Admin/Cache/DeleteHandler.php +++ b/src/Handler/Admin/Cache/DeleteHandler.php @@ -2,7 +2,8 @@ namespace Pi\User\Handler\Admin\Cache; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\Core\Service\CacheService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -46,6 +47,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface ], 'error' => new \stdClass(), ]; - return new JsonResponse($result); + return new EscapingJsonResponse($result); } } diff --git a/src/Handler/Admin/Cache/ListHandler.php b/src/Handler/Admin/Cache/ListHandler.php index 26a3abf..b759f19 100644 --- a/src/Handler/Admin/Cache/ListHandler.php +++ b/src/Handler/Admin/Cache/ListHandler.php @@ -2,7 +2,7 @@ namespace Pi\User\Handler\Admin\Cache; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\Core\Service\CacheService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -44,6 +44,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface ], 'error' => new \stdClass(), ]; - return new JsonResponse($result); + return new EscapingJsonResponse($result); } } diff --git a/src/Handler/Admin/Cache/PersistHandler.php b/src/Handler/Admin/Cache/PersistHandler.php index 4b11277..63a21dc 100644 --- a/src/Handler/Admin/Cache/PersistHandler.php +++ b/src/Handler/Admin/Cache/PersistHandler.php @@ -2,7 +2,7 @@ namespace Pi\User\Handler\Admin\Cache; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\Core\Service\CacheService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -46,6 +46,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface ], 'error' => new \stdClass(), ]; - return new JsonResponse($result); + return new EscapingJsonResponse($result); } } diff --git a/src/Handler/Admin/Cache/ViewHandler.php b/src/Handler/Admin/Cache/ViewHandler.php index a70d53c..eec6c88 100644 --- a/src/Handler/Admin/Cache/ViewHandler.php +++ b/src/Handler/Admin/Cache/ViewHandler.php @@ -2,7 +2,7 @@ namespace Pi\User\Handler\Admin\Cache; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\Core\Service\CacheService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -44,6 +44,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface 'data' => $item, 'error' => new \stdClass(), ]; - return new JsonResponse($result); + return new EscapingJsonResponse($result); } } diff --git a/src/Handler/Admin/Permission/Page/ListHandler.php b/src/Handler/Admin/Permission/Page/ListHandler.php index e5eae31..ceeb2f5 100644 --- a/src/Handler/Admin/Permission/Page/ListHandler.php +++ b/src/Handler/Admin/Permission/Page/ListHandler.php @@ -3,7 +3,7 @@ namespace Pi\User\Handler\Admin\Permission\Page; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\PermissionService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -43,6 +43,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface 'error' => new \stdClass(), ]; - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } diff --git a/src/Handler/Admin/Permission/Resource/ListHandler.php b/src/Handler/Admin/Permission/Resource/ListHandler.php index ccf28a2..aa8237e 100644 --- a/src/Handler/Admin/Permission/Resource/ListHandler.php +++ b/src/Handler/Admin/Permission/Resource/ListHandler.php @@ -3,7 +3,7 @@ namespace Pi\User\Handler\Admin\Permission\Resource; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\PermissionService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -43,6 +43,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface 'error' => new \stdClass(), ]; - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Admin/Permission/Role/ListHandler.php b/src/Handler/Admin/Permission/Role/ListHandler.php index 2c79464..99d3973 100644 --- a/src/Handler/Admin/Permission/Role/ListHandler.php +++ b/src/Handler/Admin/Permission/Role/ListHandler.php @@ -3,7 +3,7 @@ namespace Pi\User\Handler\Admin\Permission\Role; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\PermissionService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -43,6 +43,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface 'error' => new \stdClass(), ]; - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Admin/Profile/AddHandler.php b/src/Handler/Admin/Profile/AddHandler.php index 56ecc9d..8442177 100644 --- a/src/Handler/Admin/Profile/AddHandler.php +++ b/src/Handler/Admin/Profile/AddHandler.php @@ -2,7 +2,7 @@ namespace Pi\User\Handler\Admin\Profile; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -39,10 +39,10 @@ public function handle(ServerRequestInterface $request): ResponseInterface if (isset($result['id']) && !empty($result)) { $this->accountService->addRoleAccountByAdmin($requestBody, $result, $operator); } else { - return new JsonResponse($result); + return new EscapingJsonResponse($result); } - return new JsonResponse( + return new EscapingJsonResponse( [ 'result' => true, 'data' => $result, diff --git a/src/Handler/Admin/Profile/CleanHandler.php b/src/Handler/Admin/Profile/CleanHandler.php index 368ee2c..ea7f5e7 100644 --- a/src/Handler/Admin/Profile/CleanHandler.php +++ b/src/Handler/Admin/Profile/CleanHandler.php @@ -3,7 +3,7 @@ namespace Pi\User\Handler\Admin\Profile; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -47,6 +47,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface 'error' => [], ]; - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Admin/Profile/DeleteHandler.php b/src/Handler/Admin/Profile/DeleteHandler.php index 99f539d..d77a6b7 100644 --- a/src/Handler/Admin/Profile/DeleteHandler.php +++ b/src/Handler/Admin/Profile/DeleteHandler.php @@ -3,7 +3,7 @@ namespace Pi\User\Handler\Admin\Profile; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -38,6 +38,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface $operator = $request->getAttribute('account'); $result = $this->accountService->deleteUserByAdmin($requestBody, $operator); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Admin/Profile/EditHandler.php b/src/Handler/Admin/Profile/EditHandler.php index 27a933b..ce532d6 100644 --- a/src/Handler/Admin/Profile/EditHandler.php +++ b/src/Handler/Admin/Profile/EditHandler.php @@ -2,7 +2,7 @@ namespace Pi\User\Handler\Admin\Profile; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -47,7 +47,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface $this->accountService->updateAccountRoles($requestBody['roles'], $updatedAccount, 'all', $operator); } - return new JsonResponse( + return new EscapingJsonResponse( [ 'result' => true, 'data' => $updatedAccount, diff --git a/src/Handler/Admin/Profile/ExportHandler.php b/src/Handler/Admin/Profile/ExportHandler.php index b72226d..1dcb5ed 100644 --- a/src/Handler/Admin/Profile/ExportHandler.php +++ b/src/Handler/Admin/Profile/ExportHandler.php @@ -3,7 +3,7 @@ namespace Pi\User\Handler\Admin\Profile; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\Media\Service\MediaService; use Pi\User\Service\AccountService; use Pi\User\Service\ExportService; @@ -51,6 +51,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface $account = $this->accountService->getAccountList($params); $export = $this->exportService->exportData($account); $result = $this->mediaService->streamFile($export); - return new JsonResponse($result, StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Admin/Profile/ListHandler.php b/src/Handler/Admin/Profile/ListHandler.php index 04831fa..2fe2628 100644 --- a/src/Handler/Admin/Profile/ListHandler.php +++ b/src/Handler/Admin/Profile/ListHandler.php @@ -2,7 +2,7 @@ namespace Pi\User\Handler\Admin\Profile; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -36,7 +36,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface $requestBody = $request->getParsedBody(); $result = $this->accountService->getAccountProfileList($requestBody); - return new JsonResponse( + return new EscapingJsonResponse( [ 'result' => true, 'data' => $result, diff --git a/src/Handler/Admin/Profile/PasswordHandler.php b/src/Handler/Admin/Profile/PasswordHandler.php index fe4df7e..e092081 100644 --- a/src/Handler/Admin/Profile/PasswordHandler.php +++ b/src/Handler/Admin/Profile/PasswordHandler.php @@ -3,13 +3,13 @@ namespace Pi\User\Handler\Admin\Profile; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; class PasswordHandler implements RequestHandlerInterface { @@ -37,6 +37,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface $requestBody = $request->getParsedBody(); $operator = $request->getAttribute('account'); $result = $this->accountService->updatePasswordByAdmin($requestBody, $operator); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Admin/Profile/StatusHandler.php b/src/Handler/Admin/Profile/StatusHandler.php index ede653b..ea1e752 100644 --- a/src/Handler/Admin/Profile/StatusHandler.php +++ b/src/Handler/Admin/Profile/StatusHandler.php @@ -3,13 +3,13 @@ namespace Pi\User\Handler\Admin\Profile; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; class StatusHandler implements RequestHandlerInterface { @@ -38,6 +38,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface $operator = $request->getAttribute('account'); $result = $this->accountService->updateStatusByAdmin($requestBody, $operator); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Admin/Profile/ViewHandler.php b/src/Handler/Admin/Profile/ViewHandler.php index e47f44e..8ef9633 100644 --- a/src/Handler/Admin/Profile/ViewHandler.php +++ b/src/Handler/Admin/Profile/ViewHandler.php @@ -3,13 +3,13 @@ namespace Pi\User\Handler\Admin\Profile; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; class ViewHandler implements RequestHandlerInterface { @@ -46,6 +46,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface 'error' => [], ]; - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Admin/Role/AddHandler.php b/src/Handler/Admin/Role/AddHandler.php index dc0aba5..8c34e31 100644 --- a/src/Handler/Admin/Role/AddHandler.php +++ b/src/Handler/Admin/Role/AddHandler.php @@ -2,7 +2,7 @@ namespace Pi\User\Handler\Admin\Role; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\RoleService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -53,7 +53,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface } if ($isDuplicate || !isset($requestBody['name']) || empty($requestBody['name'])) { - return new JsonResponse( + return new EscapingJsonResponse( [ 'result' => false, 'data' => new stdClass(), @@ -68,7 +68,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface // Add role $result = $this->roleService->addRoleResource($requestBody, $operator); - return new JsonResponse( + return new EscapingJsonResponse( [ 'result' => true, 'data' => $result, diff --git a/src/Handler/Admin/Role/DeleteHandler.php b/src/Handler/Admin/Role/DeleteHandler.php index 9bd051a..530c58d 100644 --- a/src/Handler/Admin/Role/DeleteHandler.php +++ b/src/Handler/Admin/Role/DeleteHandler.php @@ -2,7 +2,7 @@ namespace Pi\User\Handler\Admin\Role; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\RoleService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -40,7 +40,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface // Delete $this->roleService->deleteRoleResource($requestBody, $operator); - return new JsonResponse( + return new EscapingJsonResponse( [ 'result' => true, 'data' => new stdClass(), diff --git a/src/Handler/Admin/Role/EditHandler.php b/src/Handler/Admin/Role/EditHandler.php index 5667f26..c73db97 100644 --- a/src/Handler/Admin/Role/EditHandler.php +++ b/src/Handler/Admin/Role/EditHandler.php @@ -2,7 +2,7 @@ namespace Pi\User\Handler\Admin\Role; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\RoleService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -40,7 +40,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface // Update $this->roleService->updateRoleResource($requestBody, $operator); - return new JsonResponse( + return new EscapingJsonResponse( [ 'result' => true, 'data' => new stdClass(), diff --git a/src/Handler/Admin/Role/ListHandler.php b/src/Handler/Admin/Role/ListHandler.php index 3fa480a..9cc2c3d 100644 --- a/src/Handler/Admin/Role/ListHandler.php +++ b/src/Handler/Admin/Role/ListHandler.php @@ -2,7 +2,7 @@ namespace Pi\User\Handler\Admin\Role; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\RoleService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -49,6 +49,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface ], 'error' => new \stdClass(), ]; - return new JsonResponse($result); + return new EscapingJsonResponse($result); } } diff --git a/src/Handler/Api/Authentication/Email/RequestHandler.php b/src/Handler/Api/Authentication/Email/RequestHandler.php index 149782e..b0edca3 100644 --- a/src/Handler/Api/Authentication/Email/RequestHandler.php +++ b/src/Handler/Api/Authentication/Email/RequestHandler.php @@ -3,13 +3,13 @@ namespace Pi\User\Handler\Api\Authentication\Email; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; class RequestHandler implements RequestHandlerInterface { @@ -39,6 +39,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface // Do log in $result = $this->accountService->preMailLogin($requestBody); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Authentication/Email/VerifyHandler.php b/src/Handler/Api/Authentication/Email/VerifyHandler.php index 264f917..883901d 100644 --- a/src/Handler/Api/Authentication/Email/VerifyHandler.php +++ b/src/Handler/Api/Authentication/Email/VerifyHandler.php @@ -3,13 +3,13 @@ namespace Pi\User\Handler\Api\Authentication\Email; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; class VerifyHandler implements RequestHandlerInterface { @@ -50,6 +50,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface // Do log in $result = $this->accountService->login($params); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Authentication/LogoutHandler.php b/src/Handler/Api/Authentication/LogoutHandler.php index 8fc95f7..b3890f8 100644 --- a/src/Handler/Api/Authentication/LogoutHandler.php +++ b/src/Handler/Api/Authentication/LogoutHandler.php @@ -3,7 +3,7 @@ namespace Pi\User\Handler\Api\Authentication; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\AccountService; use Pi\User\Service\TokenService; use Psr\Http\Message\ResponseFactoryInterface; @@ -52,6 +52,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface $result = $this->accountService->logout($params); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Authentication/Mfa/RequestHandler.php b/src/Handler/Api/Authentication/Mfa/RequestHandler.php index aed2a49..559d2c6 100644 --- a/src/Handler/Api/Authentication/Mfa/RequestHandler.php +++ b/src/Handler/Api/Authentication/Mfa/RequestHandler.php @@ -3,13 +3,13 @@ namespace Pi\User\Handler\Api\Authentication\Mfa; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; class RequestHandler implements RequestHandlerInterface { @@ -39,6 +39,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface // Do log in $result = $this->accountService->requestMfa($account); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Authentication/Mfa/VerifyHandler.php b/src/Handler/Api/Authentication/Mfa/VerifyHandler.php index 258c550..ccd2c5b 100644 --- a/src/Handler/Api/Authentication/Mfa/VerifyHandler.php +++ b/src/Handler/Api/Authentication/Mfa/VerifyHandler.php @@ -3,13 +3,13 @@ namespace Pi\User\Handler\Api\Authentication\Mfa; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; class VerifyHandler implements RequestHandlerInterface { @@ -40,6 +40,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface $result = $this->accountService->verifyMfa($account, $requestBody, $tokenId); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Authentication/Mobile/RequestHandler.php b/src/Handler/Api/Authentication/Mobile/RequestHandler.php index 026d7e7..6ca68d6 100644 --- a/src/Handler/Api/Authentication/Mobile/RequestHandler.php +++ b/src/Handler/Api/Authentication/Mobile/RequestHandler.php @@ -3,13 +3,13 @@ namespace Pi\User\Handler\Api\Authentication\Mobile; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; class RequestHandler implements RequestHandlerInterface { @@ -39,6 +39,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface // Do log in $result = $this->accountService->perMobileLogin($requestBody); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Authentication/Mobile/VerifyHandler.php b/src/Handler/Api/Authentication/Mobile/VerifyHandler.php index ffd3c7e..1de60b7 100644 --- a/src/Handler/Api/Authentication/Mobile/VerifyHandler.php +++ b/src/Handler/Api/Authentication/Mobile/VerifyHandler.php @@ -3,13 +3,13 @@ namespace Pi\User\Handler\Api\Authentication\Mobile; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; class VerifyHandler implements RequestHandlerInterface { @@ -50,6 +50,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface // Do log in $result = $this->accountService->login($params); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Authentication/Oauth/GoogleHandler.php b/src/Handler/Api/Authentication/Oauth/GoogleHandler.php index c2ac4f1..2853931 100644 --- a/src/Handler/Api/Authentication/Oauth/GoogleHandler.php +++ b/src/Handler/Api/Authentication/Oauth/GoogleHandler.php @@ -4,7 +4,7 @@ use Fig\Http\Message\StatusCodeInterface; use Hybridauth\Exception\UnexpectedApiResponseException; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Authentication\Oauth\Google; use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; @@ -60,6 +60,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface // Do log in $result = $this->accountService->loginOauth($userData); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Authentication/Oauth/MicrosoftHandler.php b/src/Handler/Api/Authentication/Oauth/MicrosoftHandler.php index fcf2a6c..53c032e 100644 --- a/src/Handler/Api/Authentication/Oauth/MicrosoftHandler.php +++ b/src/Handler/Api/Authentication/Oauth/MicrosoftHandler.php @@ -4,7 +4,7 @@ use Fig\Http\Message\StatusCodeInterface; use Hybridauth\Exception\UnexpectedApiResponseException; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Authentication\Oauth\Microsoft; use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; @@ -62,6 +62,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface // Do log in $result = $this->accountService->loginOauth($userData); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Authentication/Oauth/Oauth2Handler.php b/src/Handler/Api/Authentication/Oauth/Oauth2Handler.php index a6705e2..046edef 100644 --- a/src/Handler/Api/Authentication/Oauth/Oauth2Handler.php +++ b/src/Handler/Api/Authentication/Oauth/Oauth2Handler.php @@ -3,14 +3,14 @@ namespace Pi\User\Handler\Api\Authentication\Oauth; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Authentication\Oauth\Oauth2; +use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Authentication\Oauth\Oauth2; -use Pi\User\Service\AccountService; class Oauth2Handler implements RequestHandlerInterface { @@ -53,7 +53,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface 'message' => 'Invalid authentication data. please try again!', ], ]; - return new JsonResponse($errorResponse, StatusCodeInterface::STATUS_UNAUTHORIZED); + return new EscapingJsonResponse($errorResponse, StatusCodeInterface::STATUS_UNAUTHORIZED); } @@ -61,12 +61,12 @@ public function handle(ServerRequestInterface $request): ResponseInterface $authService = new Oauth2($this->config); $result = $authService->verifyToken($requestBody); if (!$result['result']) { - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } // Do log in $result = $this->accountService->loginOauth2(array_merge($result['data'], ['security_stream' => $securityStream])); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Authentication/Oauth/SettingHandler.php b/src/Handler/Api/Authentication/Oauth/SettingHandler.php index 130f0f7..166e556 100644 --- a/src/Handler/Api/Authentication/Oauth/SettingHandler.php +++ b/src/Handler/Api/Authentication/Oauth/SettingHandler.php @@ -3,13 +3,13 @@ namespace Pi\User\Handler\Api\Authentication\Oauth; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; class SettingHandler implements RequestHandlerInterface { @@ -58,6 +58,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface 'error' => [], ]; - return new JsonResponse($result, StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Authentication/RefreshHandler.php b/src/Handler/Api/Authentication/RefreshHandler.php index a27be6d..f7410fd 100644 --- a/src/Handler/Api/Authentication/RefreshHandler.php +++ b/src/Handler/Api/Authentication/RefreshHandler.php @@ -3,14 +3,14 @@ namespace Pi\User\Handler\Api\Authentication; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; +use Pi\User\Service\TokenService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; -use Pi\User\Service\TokenService; class RefreshHandler implements RequestHandlerInterface { @@ -57,6 +57,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface ]; // Set result - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } diff --git a/src/Handler/Api/Authentication/RegisterHandler.php b/src/Handler/Api/Authentication/RegisterHandler.php index aaa8e64..2a13251 100644 --- a/src/Handler/Api/Authentication/RegisterHandler.php +++ b/src/Handler/Api/Authentication/RegisterHandler.php @@ -3,14 +3,14 @@ namespace Pi\User\Handler\Api\Authentication; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; +use Pi\User\Service\TokenService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; -use Pi\User\Service\TokenService; class RegisterHandler implements RequestHandlerInterface { @@ -62,6 +62,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface ]; } - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Avatar/UploadHandler.php b/src/Handler/Api/Avatar/UploadHandler.php index dcdc2db..a1cd34c 100644 --- a/src/Handler/Api/Avatar/UploadHandler.php +++ b/src/Handler/Api/Avatar/UploadHandler.php @@ -3,14 +3,14 @@ namespace Pi\User\Handler\Api\Avatar; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; +use Pi\User\Service\AvatarService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; -use Pi\User\Service\AvatarService; class UploadHandler implements RequestHandlerInterface { @@ -52,6 +52,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface 'error' => [], ]; - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Captcha/ReCaptcha/VerifyHandler.php b/src/Handler/Api/Captcha/ReCaptcha/VerifyHandler.php index 47dadbe..1b55c93 100644 --- a/src/Handler/Api/Captcha/ReCaptcha/VerifyHandler.php +++ b/src/Handler/Api/Captcha/ReCaptcha/VerifyHandler.php @@ -3,7 +3,7 @@ namespace Pi\User\Handler\Api\Captcha\ReCaptcha; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; @@ -68,6 +68,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface ]; } - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Password/AddHandler.php b/src/Handler/Api/Password/AddHandler.php index 759f4be..5e225f3 100644 --- a/src/Handler/Api/Password/AddHandler.php +++ b/src/Handler/Api/Password/AddHandler.php @@ -3,7 +3,7 @@ namespace Pi\User\Handler\Api\Password; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\AccountService; use Pi\User\Service\TokenService; use Psr\Http\Message\ResponseFactoryInterface; @@ -44,6 +44,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface $account = $request->getAttribute('account'); $result = $this->accountService->addPassword($requestBody, $account); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } diff --git a/src/Handler/Api/Password/UpdateHandler.php b/src/Handler/Api/Password/UpdateHandler.php index 7ac4cd1..ff10c68 100644 --- a/src/Handler/Api/Password/UpdateHandler.php +++ b/src/Handler/Api/Password/UpdateHandler.php @@ -3,14 +3,14 @@ namespace Pi\User\Handler\Api\Password; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; +use Pi\User\Service\TokenService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; -use Pi\User\Service\TokenService; class UpdateHandler implements RequestHandlerInterface { @@ -44,6 +44,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface $account = $request->getAttribute('account'); $result = $this->accountService->updatePassword($requestBody, $account); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } diff --git a/src/Handler/Api/Profile/DeviceTokenHandler.php b/src/Handler/Api/Profile/DeviceTokenHandler.php index a8f0c88..a0c09ad 100644 --- a/src/Handler/Api/Profile/DeviceTokenHandler.php +++ b/src/Handler/Api/Profile/DeviceTokenHandler.php @@ -3,7 +3,7 @@ namespace Pi\User\Handler\Api\Profile; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\AccountService; use Pi\User\Service\TokenService; use Psr\Http\Message\ResponseFactoryInterface; @@ -53,6 +53,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface 'error' => [], ]; - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Profile/HistoryHandler.php b/src/Handler/Api/Profile/HistoryHandler.php index 8cca322..d653d93 100644 --- a/src/Handler/Api/Profile/HistoryHandler.php +++ b/src/Handler/Api/Profile/HistoryHandler.php @@ -3,7 +3,7 @@ namespace Pi\User\Handler\Api\Profile; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\User\Service\AccountService; use Pi\User\Service\HistoryService; use Psr\Http\Message\ResponseFactoryInterface; @@ -44,6 +44,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface $account = $request->getAttribute('account'); $result = $this->historyService->getUserLog($account, $requestBody); - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } diff --git a/src/Handler/Api/Profile/UpdateHandler.php b/src/Handler/Api/Profile/UpdateHandler.php index 6037c5e..54b620a 100644 --- a/src/Handler/Api/Profile/UpdateHandler.php +++ b/src/Handler/Api/Profile/UpdateHandler.php @@ -3,14 +3,14 @@ namespace Pi\User\Handler\Api\Profile; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; +use Pi\User\Service\TokenService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; -use Pi\User\Service\TokenService; class UpdateHandler implements RequestHandlerInterface { @@ -51,6 +51,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface 'error' => [], ]; - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } \ No newline at end of file diff --git a/src/Handler/Api/Profile/ViewHandler.php b/src/Handler/Api/Profile/ViewHandler.php index e70f415..5f18b5d 100644 --- a/src/Handler/Api/Profile/ViewHandler.php +++ b/src/Handler/Api/Profile/ViewHandler.php @@ -3,14 +3,14 @@ namespace Pi\User\Handler\Api\Profile; use Fig\Http\Message\StatusCodeInterface; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; +use Pi\User\Service\AccountService; +use Pi\User\Service\TokenService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Server\RequestHandlerInterface; -use Pi\User\Service\AccountService; -use Pi\User\Service\TokenService; class ViewHandler implements RequestHandlerInterface { @@ -50,6 +50,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface 'error' => [], ]; - return new JsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); + return new EscapingJsonResponse($result, $result['status'] ?? StatusCodeInterface::STATUS_OK); } } diff --git a/src/Handler/InstallerHandler.php b/src/Handler/InstallerHandler.php index 88bc4d5..58674ac 100644 --- a/src/Handler/InstallerHandler.php +++ b/src/Handler/InstallerHandler.php @@ -2,7 +2,7 @@ namespace Pi\User\Handler; -use Laminas\Diactoros\Response\JsonResponse; +use Pi\Core\Response\EscapingJsonResponse; use Pi\Core\Service\InstallerService; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; @@ -39,7 +39,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface $this->installerService->installPermission('user', $permissionFile); // Set result - return new JsonResponse( + return new EscapingJsonResponse( [ 'result' => true, 'data' => new stdClass(), diff --git a/src/Service/TokenService.php b/src/Service/TokenService.php index d79851b..a416e13 100644 --- a/src/Service/TokenService.php +++ b/src/Service/TokenService.php @@ -70,7 +70,7 @@ public function decryptToken($token): array !empty($decoded) && !empty($cacheUser) && $decoded->type == 'access' - && in_array($decoded->id, $cacheUser['access_keys']) + && in_array($decoded->id, array_keys($cacheUser['access_keys'])) ) { return [ 'status' => true, @@ -83,7 +83,7 @@ public function decryptToken($token): array !empty($decoded) && !empty($cacheUser) && $decoded->type == 'refresh' - && in_array($decoded->id, $cacheUser['refresh_keys']) + && in_array($decoded->id, array_keys($cacheUser['refresh_keys'])) ) { return [ 'status' => true,