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.31k stars 164 forks source link

Add server-side access to tokens and session for the `local` and `refresh` providers #854

Open zoey-kaiser opened 3 months ago

zoey-kaiser commented 3 months ago

Describe the feature

A set of simple server-side functions that mirror getServerSession and getToken from the authjs provider, but for the local and refresh providers.

How would you implement this?

Add the two new functions, extract the token via the cookie from the h3 event. To retrieve the session data, use the token and send a backend request to the configured authentication API and return the data.

Additional information

Provider