Revert "[5.8] Modify RedirectIfAuthenticated middleware to accept multiple guards"

This commit is contained in:
Taylor Otwell 2019-02-24 18:51:07 -06:00 committed by GitHub
parent 1d8add88f7
commit 44d274174f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

@ -12,16 +12,14 @@ class RedirectIfAuthenticated
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string[] ...$guards
* @param string|null $guard
* @return mixed
*/
public function handle($request, Closure $next, ...$guards)
public function handle($request, Closure $next, $guard = null)
{
foreach ($guards as $guard) {
if (Auth::guard($guard)->check()) {
return redirect('/home');
}
}
return $next($request);
}