Alexandre Alapetite 3 years ago
parent
commit
e860cdf6a8
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      src/Model/User.php

+ 7
- 7
src/Model/User.php View File

@ -127,18 +127,18 @@ class User
{
$user = self::getAuthenticationInfo($user_info);
if (password_verify($password, $user['password'])) {
if (password_needs_rehash($user['password'], PASSWORD_DEFAULT)) {
self::updatePassword($user['uid'], $password);
}
return $user['uid'];
} elseif (strpos($user['password'], '$') === false) {
if (strpos($user['password'], '$') === false) {
if (self::hashPasswordLegacy($password) === $user['password']) {
self::updatePassword($user['uid'], $password);
return $user['uid'];
}
} elseif (password_verify($password, $user['password'])) {
if (password_needs_rehash($user['password'], PASSWORD_DEFAULT)) {
self::updatePassword($user['uid'], $password);
}
return $user['uid'];
}
throw new Exception(L10n::t('Login failed'));


Loading…
Cancel
Save