Update Saqel Platform: 2026-09-08 13:43:36
This commit is contained in:
@@ -173,6 +173,11 @@ class Security
|
||||
}
|
||||
|
||||
list($headerEncoded, $payloadEncoded, $signatureEncoded) = $parts;
|
||||
|
||||
$header = json_decode(self::base64UrlDecode($headerEncoded), true);
|
||||
if (!is_array($header) || ($header['alg'] ?? '') !== 'HS256' || ($header['typ'] ?? '') !== 'JWT') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$secret = self::getJwtSecret();
|
||||
if (!$secret) {
|
||||
@@ -187,7 +192,9 @@ class Security
|
||||
}
|
||||
|
||||
$payload = json_decode(self::base64UrlDecode($payloadEncoded), true);
|
||||
if (!$payload || !isset($payload['exp']) || time() >= $payload['exp']) {
|
||||
$expectedIssuer = getenv('APP_URL') ?: 'https://saqel.intaleqapp.com';
|
||||
if (!$payload || !isset($payload['exp'], $payload['iat'], $payload['jti']) || time() >= $payload['exp']
|
||||
|| ($payload['iss'] ?? '') !== $expectedIssuer || ($payload['aud'] ?? '') !== 'saqel_app') {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user