Commit da0e5108 authored by Taylor Otwell's avatar Taylor Otwell

Cleaning up auth code.

parent 1dd13fca
...@@ -57,11 +57,11 @@ class PasswordController extends Controller { ...@@ -57,11 +57,11 @@ class PasswordController extends Controller {
{ {
switch ($response = $this->passwords->sendResetLink($request->only('email'))) switch ($response = $this->passwords->sendResetLink($request->only('email')))
{ {
case PasswordBroker::INVALID_USER:
return redirect()->back()->withErrors(['email' =>trans($response)]);
case PasswordBroker::RESET_LINK_SENT: case PasswordBroker::RESET_LINK_SENT:
return redirect()->back()->with('status', trans($response)); return redirect()->back()->with('status', trans($response));
case PasswordBroker::INVALID_USER:
return redirect()->back()->withErrors(['email' =>trans($response)]);
} }
} }
...@@ -102,15 +102,13 @@ class PasswordController extends Controller { ...@@ -102,15 +102,13 @@ class PasswordController extends Controller {
switch ($response) switch ($response)
{ {
case PasswordBroker::INVALID_PASSWORD: case PasswordBroker::PASSWORD_RESET:
case PasswordBroker::INVALID_TOKEN: return $this->loginAndRedirect($request->email);
case PasswordBroker::INVALID_USER:
default:
return redirect()->back() return redirect()->back()
->withInput($request->only('email')) ->withInput($request->only('email'))
->withErrors(['email' => trans($response)]); ->withErrors(['email' => trans($response)]);
case PasswordBroker::PASSWORD_RESET:
return $this->loginAndRedirect($request->email);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment