protected function validatePassword(LoginForm &$loginForm)
    {
        return [
            'password',
            function ($attribute) use (&$loginForm) {
                if ($loginForm->user === null ||
                    !PasswordHelper::validate($loginForm->password, $loginForm->user->password_hash)
                ) {
                    $loginForm->addError($attribute, Yii::t('users', 'Invalid login or password'));
                }
            }
        ];
    }