密码重置链接令牌不包括Laravel中的端口

问题描述 投票:0回答:1

我有一个具有多个身份验证系统的应用程序。有一个使用make:auth命令制作的系统,另外四个是我手动制作的。使用我使用make:auth命令创建的身份验证系统重置密码时,通过电子邮件发送给用户的“密码重置”链接将起作用。

我已隔离问题,发现发送的令牌不包括端口。因此,当用户单击电子邮件中收到的重置密码按钮时,会收到一条错误消息,提示“找不到对象”。如果我将端口添加到URL,则可以使用。

我去了.env文件并修改了APP_URL来添加端口,如下所示:

APP_URL = http://localhost:8000

这不能解决问题。

我未对'Illuminate \ Foundation \ Auth \ SendsPasswordResetEmails.php'文件进行任何修改。该文件中触发的函数是:

    public function sendResetLinkEmail(Request $request)
{
    $this->validateEmail($request);

    // We will send the password reset link to this user. Once we have attempted
    // to send the link, we will examine the response then see the message we
    // need to show to the user. Finally, we'll send out a proper response.
    $response = $this->broker()->sendResetLink(
        $this->credentials($request)
    );

    return $response == Password::RESET_LINK_SENT
                ? $this->sendResetLinkResponse($request, $response)
                : $this->sendResetLinkFailedResponse($request, $response);
}

我有一个具有多个身份验证系统的应用程序。有一个使用make:auth命令制作的系统,另外四个是我手动制作的。一切正常,除了密码...

laravel
1个回答
0
投票

Laravel在vendor \ laravel \ framework \ src \ Illuminate \ Auth \ Notifications \ ResetPassword]中命中ResetPassword类>从那里发送带有密码重置链接的电子邮件。

© www.soinside.com 2019 - 2024. All rights reserved.