我使用laravel-5.6默认身份验证系统来重置密码、注册和登录(php artisan make:auth)。在密码重置中,当我成功重置密码时,它会验证我的身份并将我重定向到下一页。以及注册做同样的事情。如何在重置/注册后限制那些验证我的身份?我想让它给我发一条闪电信息,让我回到'/‘路径。提亚
发布于 2018-08-06 13:38:10
密码重置:
在(lluminate/Foundation/Auth/ResetsPasswords.php)中,有一个名为“重置”的函数,负责在重置密码后登录。在ResetPasswordConroller中,您可以通过创建一个新函数来覆盖此函数,如下所示。
public function reset(Request $request)
{
$this->validate($request, $this->rules(), $this->validationErrorMessages());
// Here we will attempt to reset the user's password. If it is successful we
// will update the password on an actual user model and persist it to the
// database. Otherwise we will parse the error and return the response.
$response = $this->broker()->reset(
$this->credentials($request), function ($user, $password) {
$this->resetPassword($user, $password);
}
);
return 'whatever you wanna return.'
}我没有注册控制器的代码,但您可以使用上面提到的相同方法覆盖该方法。
https://stackoverflow.com/questions/51694025
复制相似问题