Added guest middleware and changed redirect path

This commit is contained in:
Linus Juhlin 2019-08-15 17:47:39 +02:00
parent 14352710ad
commit 788445e25e
2 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ class RedirectIfAuthenticated
public function handle($request, Closure $next, $guard = null)
{
if (Auth::guard($guard)->check()) {
return redirect('/home');
return redirect('/');
}
return $next($request);

View File

@ -12,8 +12,8 @@
*/
// Auth
Route::get('login')->name('login')->uses('Auth\LoginController@showLoginForm');
Route::post('login')->name('login.attempt')->uses('Auth\LoginController@login');
Route::get('login')->name('login')->uses('Auth\LoginController@showLoginForm')->middleware('guest');
Route::post('login')->name('login.attempt')->uses('Auth\LoginController@login')->middleware('guest');
Route::post('logout')->name('logout')->uses('Auth\LoginController@logout');
// Dashboard