Skip to content

Commit

Permalink
fix algorithm
Browse files Browse the repository at this point in the history
Signed-off-by: envoyr <[email protected]>
  • Loading branch information
envoyr committed Feb 20, 2023
1 parent f175197 commit 1b8aef1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Accounts/ApiTokenCookieFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ protected function createToken($userId, string $csrfToken, Carbon $expiration):
'sub' => $userId,
'csrf' => $csrfToken,
'expiry' => $expiration->getTimestamp(),
], $this->encrypter->getKey(), 'RS256');
], $this->encrypter->getKey(), 'HS256');
}
}
2 changes: 1 addition & 1 deletion src/Accounts/Auth/TokenGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ protected function decodeJwtTokenCookie(Request $request): array
CookieValuePrefix::remove($this->encrypter->decrypt($request->cookie(BitinflowAccounts::cookie()), BitinflowAccounts::$unserializesCookies)),
new Key(
$this->encrypter->getKey(),
'RS256'
'HS256'
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Accounts/Helpers/JwtParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function decode(Request $request): stdClass
try {
return JWT::decode(
$request->bearerToken(),
new Key($this->getOauthPublicKey(),'RS256')
new Key($this->getOauthPublicKey(), 'RS256')
);
} catch (Throwable $exception) {
throw (new AuthenticationException());
Expand Down

0 comments on commit 1b8aef1

Please sign in to comment.