ApiAwareRedirectHandler
extends RedirectHandler
in package
Re-throws authorization exceptions for API routes and XHR/fetch requests so the exception renderer returns a proper 403; redirects normal navigations.
Redirecting an XHR to the unauthorized page returns 200 HTML that embedded consumers (autocompletes, turbo modals) render inline — and that page's "redirecting you to your profile" script then hijacks the whole window.
Table of Contents
Methods
- handle() : ResponseInterface
Methods
handle()
public
handle(Exception $exception, ServerRequestInterface $request[, array<string|int, mixed> $options = [] ]) : ResponseInterface
Parameters
- $exception : Exception
- $request : ServerRequestInterface
- $options : array<string|int, mixed> = []