NuxtN
Nuxt11mo ago
4 replies
funkyj8157

nuxt middleware auth refresh

Hi. How do you guys prevent the quick flash when you refresh the page where a supabase middleware check is on? Right now i first shortly get redirected to te login page and then back to the dashboard. I think this i because the check is with supabase client so not on the server. Is this a normal thing? the code i use == export default defineNuxtRouteMiddleware((to, _from) => {
const user = useSupabaseUser()

if (!user.value) {
return navigateTo('/login')
}
})
Was this page helpful?