#458 fix on sms 2fa management

This commit is contained in:
Antonio Cordeddu
2022-08-10 15:59:52 +02:00
parent 665466e543
commit 8b6c6282f9
31 changed files with 88 additions and 78 deletions

View File

@ -583,14 +583,14 @@ class SettingsController extends Controller
$success=true;
}else{
$success = $user->updateAttributes(['auth_tf_mobile_phone' => $mobilePhone]);
$this->make(TwoFactorSmsCodeGeneratorService::class, [$user])->run();
}
}
$success = $success && $this->make(TwoFactorSmsCodeGeneratorService::class, [$user])->run();
return [
'success' => $success,
'message' => $success
? Yii::t('usuario', 'Mobile phone number successfully enabled.')
: Yii::t('usuario', 'Error while enabling SMS two factor authentication.'),
: Yii::t('usuario', 'Error while enabling SMS two factor authentication. Please reload the page.'),
];
}
}