RedirectIfAuthenticated
class RedirectIfAuthenticated (View source)
Middleware that redirects authenticated users away from guest routes.
Detects both web users (sessions) and API users (JWT via PHPOpenSourceSaver\JWTAuth). Prevents authenticated users from accessing login, register, or recovery routes.
Methods
RedirectResponse|Response
Authenticatable|null
getApiUserFromRequest(Request $request)
Attempt to get the API user from JWT in the request using JWTAuth.
Details
RedirectResponse|Response
handle(Request $request, Closure $next, string ...$guards)
Handle an incoming request.
protected Authenticatable|null
getApiUserFromRequest(Request $request)
Attempt to get the API user from JWT in the request using JWTAuth.