|
|
@ -25,16 +25,16 @@ class PassportUserRepository extends UserRepository |
|
|
|
// Avoid Hash::check() error with non-bcrypt hashes |
|
|
|
// Avoid Hash::check() error with non-bcrypt hashes |
|
|
|
if ($this->isBcryptHash($user->password)) { |
|
|
|
if ($this->isBcryptHash($user->password)) { |
|
|
|
if (Hash::check($password, $user->password)) { |
|
|
|
if (Hash::check($password, $user->password)) { |
|
|
|
return new User($user->id); |
|
|
|
return new User($user->id); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// If the hash is not bcrypt, check for MD5 manually |
|
|
|
// If the hash is not bcrypt, check for MD5 manually |
|
|
|
if (md5($password) === $user->password) { |
|
|
|
if (md5($password) === $user->password) { |
|
|
|
// Upgrade password to bcrypt |
|
|
|
// Upgrade password to bcrypt |
|
|
|
$user->password = Hash::make($password); |
|
|
|
$user->password = Hash::make($password); |
|
|
|
$user->save(); |
|
|
|
$user->save(); |
|
|
|
|
|
|
|
|
|
|
|
return new User($user->id); |
|
|
|
return new User($user->id); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|