From 1b8aef1f6f085ee6e2905a942168f07e7b1b7d0b Mon Sep 17 00:00:00 2001 From: envoyr Date: Mon, 20 Feb 2023 17:16:48 +0100 Subject: [PATCH] fix algorithm Signed-off-by: envoyr --- src/Accounts/ApiTokenCookieFactory.php | 2 +- src/Accounts/Auth/TokenGuard.php | 2 +- src/Accounts/Helpers/JwtParser.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Accounts/ApiTokenCookieFactory.php b/src/Accounts/ApiTokenCookieFactory.php index 2e5483d..d4baa86 100644 --- a/src/Accounts/ApiTokenCookieFactory.php +++ b/src/Accounts/ApiTokenCookieFactory.php @@ -77,6 +77,6 @@ class ApiTokenCookieFactory 'sub' => $userId, 'csrf' => $csrfToken, 'expiry' => $expiration->getTimestamp(), - ], $this->encrypter->getKey(), 'RS256'); + ], $this->encrypter->getKey(), 'HS256'); } } \ No newline at end of file diff --git a/src/Accounts/Auth/TokenGuard.php b/src/Accounts/Auth/TokenGuard.php index 523222a..73d91f2 100644 --- a/src/Accounts/Auth/TokenGuard.php +++ b/src/Accounts/Auth/TokenGuard.php @@ -184,7 +184,7 @@ class TokenGuard CookieValuePrefix::remove($this->encrypter->decrypt($request->cookie(BitinflowAccounts::cookie()), BitinflowAccounts::$unserializesCookies)), new Key( $this->encrypter->getKey(), - 'RS256' + 'HS256' ) ); } diff --git a/src/Accounts/Helpers/JwtParser.php b/src/Accounts/Helpers/JwtParser.php index f0d1e3f..24f9c03 100644 --- a/src/Accounts/Helpers/JwtParser.php +++ b/src/Accounts/Helpers/JwtParser.php @@ -25,7 +25,7 @@ class JwtParser try { return JWT::decode( $request->bearerToken(), - new Key($this->getOauthPublicKey(),'RS256') + new Key($this->getOauthPublicKey(), 'RS256') ); } catch (Throwable $exception) { throw (new AuthenticationException());