mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 19:14:45 +02:00
Better way
This commit is contained in:
parent
e3947e4b50
commit
f795b38db5
@ -110,13 +110,9 @@ class TwoFactorControllerTest extends ClientApiIntegrationTestCase
|
|||||||
|
|
||||||
$rawTokens = $response->json('attributes.tokens');
|
$rawTokens = $response->json('attributes.tokens');
|
||||||
$rawToken = reset($rawTokens);
|
$rawToken = reset($rawTokens);
|
||||||
|
$hashed = reset($tokens);
|
||||||
|
|
||||||
$working = false;
|
throw_unless(password_verify($rawToken, $hashed), new ExpectationFailedException(sprintf('Failed asserting that token [%s] exists as a hashed value in recovery_tokens table.', $rawToken)));
|
||||||
foreach ($tokens as $hashed) {
|
|
||||||
$working = $working || password_verify($rawToken, $hashed);
|
|
||||||
}
|
|
||||||
|
|
||||||
throw_unless($working, new ExpectationFailedException(sprintf('Failed asserting that token [%s] exists as a hashed value in recovery_tokens table.', $rawToken)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user