sidebase / nuxt-auth

Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!
https://auth.sidebase.io
MIT License
1.25k stars 162 forks source link

Ability to render during initial session refresh API call #919

Open PaulCombal opened 4 days ago

PaulCombal commented 4 days ago

Describe the feature

My project uses the local provider. On every page load, even before app.vue is rendered, a call to my authentication endpoint is made, presumably to get the authentication data.

I wouldn't have an issue with this if I could display a loading screen while the request is being made. I apologize if I missed the way to get around it.

image

This screenshot shows that the trace of the call, and I do not know if I can render anything before it finishes. The call seems to be run before the refreshHandler's init method is called.

How would you implement this?

The topic is open to discussion. Maybe the initial session refresh call can be disabled in the configuration, just like we can for enableOnWindowFocus. useAuth().refresh() would have to be called manually in the app.

Additional information

Provider