Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

akc4's avatar
Level 1

Jetstream shows login modal when session expire's, how to disable that?

I use jetstream and when my session expires and I click a link with inertia, it open's a login modal. Where can I disable the modal popup and redirect to the actual login page.

The problem is that the modal doesn't close after logging in. Instead the whole website is re-rendered in the modal and in the background I can still see the last page I was visiting. Only when I click away from the modal it close's.

Thank you.

0 likes
4 replies
ken-mills's avatar

I read that this will be addressed in Jetstream 2.^. Is there a good temporary workaround?

bricesusername's avatar

@ken-mills

My issue was when using middleware, in some cases Inertia was requesting the page over XMLHttpRequest and in other cases the page was being requested directly.

My workaround (in my middleware, but should work for other scenarios) is as follows:

if ($request->ajax()) {
    return Inertia::location(route('my-route'));
}

return redirect()->route('my-route');

Please or to participate in this conversation.