Auth0 Next Offline support

I am building a Nextjs Website with the next sdk.
Everything worked fine.
But now as i want to make it a fully offline working pwa with next-pwa, i have some problems.

If im online, then go offline page navigation works,
but if i reload the page when offline it tries to redirect to /api/auth/login" which it obviously cant

I enabled Offline Access in the API and added the offline_access scope

Heres to complete source code: schulmanager/packages/website at main · kaaax0815/schulmanager (

I think that the issue is the withPageAuthRequired Component around my Layout. Is there a way I can use it when offline?

I removed withPageAuthRequired from the Layout. Now it works. But as aspected my Header which uses the useUser hook which returns null when the user is undefined, doesnt show