supabase
supabase copied to clipboard
Refresh token on server
Quick question -- I'm making api calls on the server which require the supabase access token. My question is: is the token automatically refreshed on the server? Or just the client? I had to add this in my middleware/auth to get it to work (note, just using useSupabaseSession()) wasn't actually refreshing the token.
export default defineNuxtRouteMiddleware(async (to, _from) => {
const client = useSupabaseClient()
const session = await client.auth.getSession()
if (!session.data.session) {
return navigateTo(
Urls.SignIn({ redirectAfter: encodeURIComponent(to.fullPath) })
)
}
})
Could we potentially add an argument to useSupabaseSession which awaits on refresh token (if necessary)
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.