I have an application with multiple authentication systems. There is one system which is made using the make:auth command and four others I've made manually. Everything works except for the Password reset link that is emailed to users when resetting a password using the authentication system I made with the make:auth command.
I have isolated the issue and found that the token being sent does not include the port. Therefore, when the user clicks on the reset password button received in their email, they get an error saying 'Object not found'. If I add the port to the URL, then it works.
I went to the .env file and modified APP_URL to add the port like so:
APP_URL=http://localhost:8000
This did not solve the issue.
I have made no modifications to the 'Illuminate\Foundation\Auth\SendsPasswordResetEmails.php' file. The function triggering in this file is:
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 hits ResetPassword class at vendor\laravel\framework\src\Illuminate\Auth\Notifications\ResetPassword from where it sends email with password reset link.
In this function url(config('app.url'). this code get url (config/app.php) from app file in config folder. it auto set as localhost as base url.