Browse Source

Catch missing Certainty bundle exception when checking for exposed password in Model\User

pull/7734/head
Hypolite Petovan 2 years ago
parent
commit
db0630b0f9
1 changed files with 14 additions and 2 deletions
  1. +14
    -2
      src/Model/User.php

+ 14
- 2
src/Model/User.php View File

@ -412,6 +412,7 @@ class User
*
* @param string $password
* @return bool
* @throws Exception
*/
public static function isPasswordExposed($password)
{
@ -420,9 +421,20 @@ class User
'cacheDirectory' => get_temppath() . '/password-exposed-cache/',
]);
$PasswordExposedCHecker = new PasswordExposed\PasswordExposedChecker(null, $cache);
try {
$passwordExposedChecker = new PasswordExposed\PasswordExposedChecker(null, $cache);
return $passwordExposedChecker->passwordExposed($password) === PasswordExposed\PasswordStatus::EXPOSED;
} catch (\Exception $e) {
Logger::error('Password Exposed Exception: ' . $e->getMessage(), [
'code' => $e->getCode(),
'file' => $e->getFile(),
'line' => $e->getLine(),
'trace' => $e->getTraceAsString()
]);
return $PasswordExposedCHecker->passwordExposed($password) === PasswordExposed\PasswordStatus::EXPOSED;
return false;
}
}
/**


Loading…
Cancel
Save