Hello, im new in Laravel. Have problem with automatic logout after session expire and redirect on home page.
When session expire, redirect me on domain.com/public/auth.signin and show custom 404 error page.
How can I redirect on home page?
Thanks, Marko S.
you just set redirection in Auth Controller protected $redirectTo = '/home'; Auth middleware return redirect()->guest('login');
Thanks
public function handle($request, Closure $next, $guard = null) { if (Auth::guard($guard)->guest()) { if ($request->ajax() || $request->wantsJson()) { return response('Unauthorized.', 401); } else { return redirect()->guest('signin'); } }
return $next($request);
}
this is my new code i think this working now
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community