Merge pull request #39 from Juhlinus/auth-redirect
Added guest middleware and changed redirect path
This commit is contained in:
commit
99c7172f32
|
@ -18,7 +18,7 @@ class RedirectIfAuthenticated
|
||||||
public function handle($request, Closure $next, $guard = null)
|
public function handle($request, Closure $next, $guard = null)
|
||||||
{
|
{
|
||||||
if (Auth::guard($guard)->check()) {
|
if (Auth::guard($guard)->check()) {
|
||||||
return redirect('/home');
|
return redirect('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Auth
|
// Auth
|
||||||
Route::get('login')->name('login')->uses('Auth\LoginController@showLoginForm');
|
Route::get('login')->name('login')->uses('Auth\LoginController@showLoginForm')->middleware('guest');
|
||||||
Route::post('login')->name('login.attempt')->uses('Auth\LoginController@login');
|
Route::post('login')->name('login.attempt')->uses('Auth\LoginController@login')->middleware('guest');
|
||||||
Route::post('logout')->name('logout')->uses('Auth\LoginController@logout');
|
Route::post('logout')->name('logout')->uses('Auth\LoginController@logout');
|
||||||
|
|
||||||
// Dashboard
|
// Dashboard
|
||||||
|
|
Loading…
Reference in New Issue