mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
Merge pull request #4949 from laravel/revert-4904-modify-redirect-if-auth-middleware-to-allow-multiple-guards
Revert "[5.8] Modify RedirectIfAuthenticated middleware to accept multiple guards"
This commit is contained in:
commit
b5b2341fd6
@ -12,15 +12,13 @@ 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');
|
||||
}
|
||||
if (Auth::guard($guard)->check()) {
|
||||
return redirect('/home');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
Loading…
x
Reference in New Issue
Block a user