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');
}
}
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!
The Laravel portal for problem solving, knowledge sharing and community building.
The community