首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >重置密码后限制登录laravel 5.6

重置密码后限制登录laravel 5.6
EN

Stack Overflow用户
提问于 2018-08-05 19:46:29
回答 1查看 708关注 0票数 0

我使用laravel-5.6默认身份验证系统来重置密码、注册和登录(php artisan make:auth)。在密码重置中,当我成功重置密码时,它会验证我的身份并将我重定向到下一页。以及注册做同样的事情。如何在重置/注册后限制那些验证我的身份?我想让它给我发一条闪电信息,让我回到'/‘路径。提亚

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-08-06 13:38:10

密码重置:

在(lluminate/Foundation/Auth/ResetsPasswords.php)中,有一个名为“重置”的函数,负责在重置密码后登录。在ResetPasswordConroller中,您可以通过创建一个新函数来覆盖此函数,如下所示。

代码语言:javascript
复制
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.'
}

我没有注册控制器的代码,但您可以使用上面提到的相同方法覆盖该方法。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51694025

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档