Fix auth in User class

This commit is contained in:
BitHeaven 2024-08-09 22:31:15 +05:00
parent 129c0c1264
commit 913db80c30
1 changed files with 2 additions and 2 deletions

View File

@ -74,11 +74,11 @@
return false; return false;
$until = time() + self::$tokenLifetime; $until = time() + self::$tokenLifetime;
$hash = hash('sha256', $login.'|'.$password.'|'.$until.'|'.self::$secret); $hash = hash('sha256', $login.'|'.$user->password.'|'.$until.'|'.self::$secret);
self::updateOnline($login); self::updateOnline($login);
return implode('|', rtrim(strtr(base64_encode($login.'|'.$password.'|'.$until.'|'.$hash), '+/', '-_'), '=')); return rtrim(strtr(base64_encode($login.'|'.$user->password.'|'.$until.'|'.$hash), '+/', '-_'), '=');
} }
public static function get($login) { public static function get($login) {