Fix validation for user current password (#5186)

This commit is contained in:
Yuriy Bakhtin 2021-07-22 16:41:26 +03:00 committed by GitHub
parent b7ddfd57e2
commit 53662c6032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,7 @@ class CheckPasswordValidator extends Validator
* @param User $user the user or null for current
* @return boolean
*/
public static function hasPassword(ModelUser $user = null)
public static function hasPassword(ModelUser $user = null): bool
{
if ($user === null) {
$user = Yii::$app->user->getIdentity();
@ -57,7 +57,7 @@ class CheckPasswordValidator extends Validator
return false;
}
return !empty($user->currentPassword->currentPassword);
return !empty($user->currentPassword->password);
}
}