Closed niciz closed 9 months ago
Out of curiosity, what error is it throwing?
Please add entry in changelog.
`
/**
* Forces the user to change password at next login
* @param integer $id
*/
public function actionForcePasswordChange($id)
{
/** @var User $user */
$user = $this->userQuery->where(['id' => $id])->one();
if ($this->make(PasswordExpireService::class, [$user])->run()) {
Yii::$app->session->setFlash("success", Yii::t('usuario', 'User will be required to change password at next login'));
} else {
Yii::$app->session->setFlash("danger", Yii::t('usuario', 'There was an error in saving user'));
}
$this->redirect(['index']);
}
`
Is AdminController::actionForcePasswordChange() which set an error flash message when PasswordExpireService return false. But there's no error in PasswordExpireService, because user already has "password_changed_at" at NULL.
Ok. So the if
in the patch is not really required, you could just run the updateAttributes
and always return true
.
please add changelog, then I'll merge. thanks
Fix PasswordExpireService return error when user model attribute "password_changed_at" is already set at null.