Skip to content

Commit 0ca5d6d

Browse files
committed
Upgrade passwords to bcrypt
1 parent a9481e1 commit 0ca5d6d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/controllers/User/Login.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ protected function tryLogin(Router &$router, UserLoginModel &$model) {
8282
if ($model->error) return;
8383
$model->error = false;
8484

85+
// Upgrade old password (we checked it matches earlier above)
86+
if (substr($user->getPasswordHash(), 0, 1) !== '$') {
87+
$user->changePassword($password);
88+
}
89+
8590
Authentication::login( $user );
8691

8792
Logger::logEvent(

0 commit comments

Comments
 (0)