diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index 0fb64d2d8f..b0c3c043fc 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -117,6 +117,10 @@ class AuthController extends Controller */ public function getLoginWrapper() { + if (auth()->check()) { + return redirect('/'); + } + if (! Utils::isNinja() && ! User::count()) { return redirect()->to('/setup'); } diff --git a/app/Http/Controllers/Auth/PasswordController.php b/app/Http/Controllers/Auth/PasswordController.php index 42fa1c76d9..97e84eb586 100644 --- a/app/Http/Controllers/Auth/PasswordController.php +++ b/app/Http/Controllers/Auth/PasswordController.php @@ -35,4 +35,18 @@ class PasswordController extends Controller { $this->middleware('guest'); } + + /** + * Display the form to request a password reset link. + * + * @return \Illuminate\Http\Response + */ + public function getEmailWrapper() + { + if (auth()->check()) { + return redirect('/'); + } + + return $this->getEmail(); + } } diff --git a/app/Http/routes.php b/app/Http/routes.php index e604c0b99f..23b4950447 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -88,7 +88,7 @@ Route::get('/signup', ['as' => 'signup', 'uses' => 'Auth\AuthController@getRegis Route::post('/signup', ['as' => 'signup', 'uses' => 'Auth\AuthController@postRegister']); Route::get('/login', ['as' => 'login', 'uses' => 'Auth\AuthController@getLoginWrapper']); Route::get('/logout', ['as' => 'logout', 'uses' => 'Auth\AuthController@getLogoutWrapper']); -Route::get('/recover_password', ['as' => 'forgot', 'uses' => 'Auth\PasswordController@getEmail']); +Route::get('/recover_password', ['as' => 'forgot', 'uses' => 'Auth\PasswordController@getEmailWrapper']); Route::get('/password/reset/{token}', ['as' => 'forgot', 'uses' => 'Auth\PasswordController@getReset']); Route::get('/auth/{provider}', 'Auth\AuthController@authLogin');