JWT introduce other algorithms
This commit is contained in:
@@ -99,7 +99,7 @@ class Context {
|
||||
try {
|
||||
$token = $_COOKIE['session'];
|
||||
$settings = $this->configuration->getSettings();
|
||||
$decoded = (array)JWT::decode($token, $settings->getJwtKey());
|
||||
$decoded = (array)JWT::decode($token, $settings->getJwtSecretKey());
|
||||
if (!is_null($decoded)) {
|
||||
$userId = ($decoded['userId'] ?? NULL);
|
||||
$sessionId = ($decoded['sessionId'] ?? NULL);
|
||||
|
||||
@@ -74,8 +74,8 @@ class Session extends DatabaseEntity {
|
||||
$this->updateMetaData();
|
||||
$settings = $this->context->getSettings();
|
||||
$token = ['userId' => $this->user->getId(), 'sessionId' => $this->getId()];
|
||||
$jwtKey = $settings->getJwtKey();
|
||||
return JWT::encode($token, $jwtKey->getKeyMaterial(), $jwtKey->getAlgorithm());
|
||||
$jwtPublicKey = $settings->getJwtPublicKey();
|
||||
return JWT::encode($token, $jwtPublicKey->getKeyMaterial(), $jwtPublicKey->getAlgorithm());
|
||||
}
|
||||
|
||||
public function sendCookie(string $domain) {
|
||||
|
||||
Reference in New Issue
Block a user