fix: edge cases

This commit is contained in:
loks0n
2023-10-09 14:49:07 +01:00
parent e94631f730
commit c4e82e4191
3 changed files with 14 additions and 7 deletions
+2 -1
View File
@@ -340,7 +340,8 @@ class Auth
if (
$token->isSet('secret') &&
$token->isSet('expire') &&
($type === null || $token->isSet('type') && $token->getAttribute('type') === $type) &&
$token->isSet('type') &&
($type === null || $token->getAttribute('type') === $type) &&
$token->getAttribute('secret') === self::hash($secret) &&
DateTime::formatTz($token->getAttribute('expire')) >= DateTime::formatTz(DateTime::now())
) {