Anghor
Anghor

Reputation: 93

Laravel 5.1: Password reset post returns blank page

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

Answers (1)

Lance Pioch
Lance Pioch

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

Related Questions