AuthenticationRedirects
class AuthenticationRedirects
Single source of truth for boot-time auth redirect wiring.
Configures the worker-lifetime redirect callbacks on the auth/guest middleware and the authentication exception; it does not resolve or issue redirects at runtime.
Methods
Configure where guests are redirected by the "auth" middleware.
Configure where users are redirected by the "guest" middleware.
Configure where users are redirected by the authentication and guest middleware.
Details
at line 27
static void
redirectGuestsTo(callable|string|null $redirect)
Configure where guests are redirected by the "auth" middleware.
Boot-only. The callback persists in authentication middleware and exception static properties for the worker lifetime and affects every subsequent unauthenticated or session-mismatch request.
at line 43
static void
redirectUsersTo(callable|string $redirect)
Configure where users are redirected by the "guest" middleware.
Boot-only. The callback persists in the guest middleware static property for the worker lifetime and affects every subsequent already-authenticated guest-route request.
at line 55
static void
redirectTo(callable|string|null $guests = null, callable|string|null $users = null)
Configure where users are redirected by the authentication and guest middleware.
Boot-only. The callbacks persist in authentication middleware and exception static properties for the worker lifetime and affect every subsequent matching request.