【发布时间】:2020-05-15 08:59:50
【问题描述】:
我有一个包含多个身份验证系统的应用程序。有一个系统是使用 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);
}
【问题讨论】:
标签: laravel