Inertia calls are executed via AJAX, so when one of those runs into an expired session, a CORS error will be triggered (the login redirect will result in a different URL than indicated in the preflight request).
This commit catches Inertia calls and does a hard Inertia redirect. This will not impact other AJAX calls. Also, this only needs to be handled in the keycloak.login route, since that can be triggered any time via the KeycloakAuthenticated middleware.
Inertia calls are executed via AJAX, so when one of those runs into an expired session, a CORS error will be triggered (the login redirect will result in a different URL than indicated in the preflight request).
This commit catches Inertia calls and does a hard Inertia redirect. This will not impact other AJAX calls. Also, this only needs to be handled in the keycloak.login route, since that can be triggered any time via the KeycloakAuthenticated middleware.