Browse Source

Cleaning up auth code.

Taylor Otwell 10 years ago
parent
commit
da0e510872
1 changed files with 7 additions and 9 deletions
  1. 7 9
      app/Http/Controllers/Auth/PasswordController.php

+ 7 - 9
app/Http/Controllers/Auth/PasswordController.php

@@ -57,11 +57,11 @@ class PasswordController extends Controller {
 	{
 		switch ($response = $this->passwords->sendResetLink($request->only('email')))
 		{
-			case PasswordBroker::INVALID_USER:
-				return redirect()->back()->withErrors(['email' =>trans($response)]);
-
 			case PasswordBroker::RESET_LINK_SENT:
 				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 {
 
 		switch ($response)
 		{
-			case PasswordBroker::INVALID_PASSWORD:
-			case PasswordBroker::INVALID_TOKEN:
-			case PasswordBroker::INVALID_USER:
+			case PasswordBroker::PASSWORD_RESET:
+				return $this->loginAndRedirect($request->email);
+
+			default:
 				return redirect()->back()
 							->withInput($request->only('email'))
 							->withErrors(['email' => trans($response)]);
-
-			case PasswordBroker::PASSWORD_RESET:
-				return $this->loginAndRedirect($request->email);
 		}
 	}