Next.js Discord

Discord Forum

Loading screen during middleware.js execution

Unanswered
Citrus blackfly parasitoid posted this in #help-forum
Open in Discord
Avatar
Citrus blackfly parasitoidOP
What get's displayed during the execution of middleware before page load [say i am routing to a new page].
What happens then?

Can we display a custom loading page?

3 Replies

Avatar
Nothing, and no, you can’t have a loading page
Avatar
Citrus blackfly parasitoidOP
Any alternative?
How would you suggest we implement the following

I have a refresh token in cookie, But I want it to be validated before, the page...

anyway, we can show a default page, and then the middleware redirects to the appropritate page?
Avatar
refreshing the token should be very fast though