Reputation: 93
Got huge problem with password reset.
All works fine until I send e-mail for password reset.
I've changed postEmail()
function to following:
public function postEmail(Request $request)
{
$this->validate($request, ['email' => 'required|email']);
$response = Password::sendResetLink($request->only('email'), function (Message $message) {
$message->subject($this->getEmailSubject());
});
switch ($response) {
case Password::RESET_LINK_SENT:
return redirect('/');
case Password::INVALID_USER:
return redirect()->back()->withErrors(['email' => trans($response)]);
}
}
But whatever I try i always receive blank page - like redirect doesn't work at all... E-mail is sent correctly but there is no redirect action.
Any ideas what can go wrong?
Upvotes: 2
Views: 558
Reputation: 1167
There's no default case on the switch statement. The end of the function is being reached with no redirect or response being returned, which means that Laravel will generate a blank page for it.
Upvotes: 1