testing RedirectIfAuthenticated middleware

This commit is contained in:
2018-11-04 13:13:52 -06:00
parent 7529c3b9e0
commit 5e19d70482
2 changed files with 21 additions and 4 deletions

View File

@@ -16,6 +16,16 @@ use Seat\Eseye\Eseye;
class RedirectIfAuthenticated
{
public function handle($request, Closure $next, $guard = null)
{
if (Auth::guard($guard)->check()) {
return redirect('/home');
}
return $next($request);
}
/**
* Handle an incoming request.
*
@@ -24,6 +34,7 @@ class RedirectIfAuthenticated
* @param string|null $guard
* @return mixed
*/
/*
public function handle($request, Closure $next, $guard = null)
{
if($request->pathInfo == '/login' && Auth::guard($guard)->check()) {
@@ -39,6 +50,7 @@ class RedirectIfAuthenticated
return $next($request);
}
}
*/
/**
* Update the user information in the database