Support the ongoing development of →
Authentication Security Requests
Last updated 1 month ago.

I guess you could add a condition to your middleware to check for that.

public function handle($request, Closure $next)
       if ($this->auth->check() or $request->is("auth/login"))
                return $next($request);
       } else
                return redirect()->guest('auth/login');
Last updated 7 years ago.

I had the exact same question and I came with the same 2 answers. But I believe the "plan B" is better. Don't touch the AuthController and instead group all the routes that need the middleware together, and just put your couple of auth routes that don't take the middleware on the top. Clean and clear.


Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 - All rights reserved.