fixes on tests

This commit is contained in:
2021-12-08 10:56:39 +00:00
parent 56dd825f39
commit fa5001265f
26 changed files with 146 additions and 136 deletions

View File

@@ -61,7 +61,7 @@ class TokenManager
throw new UnexpectedValueException('username should not be empty to generate a token');
}
$timestamp = $expiration->getTimestamp();
$timestamp = (string) $expiration->getTimestamp();
$hash = hash('sha1', $token . $username . $timestamp . $this->secret);
return [
@@ -72,7 +72,7 @@ class TokenManager
];
}
public function verify($hash, $token, User $user, $timestamp)
public function verify($hash, $token, User $user, string $timestamp)
{
$token = hex2bin(trim($token));