You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an easy way to NOT allow logged in users to access the login/register pages? Once the user is logged in there should be no reason to access those pages, instead they should be redirected to the index page.('/')
Ive tried adding route redirects in the nuxt.config as well as adding a middleware to the login/register pages butt he page is accessed first for a few seconds before it gets redirected to the index page ('/').
loggedIn.ts middleware export default defineNuxtRouteMiddleware(async (to, from) => { const user = useSupabaseUser(); if (user.value) return navigateTo('/'); });
This is not working as expected because it seems there is a few second delay on page load when user accesses the url directly and when the redirect(navigateTo) is fired.
The text was updated successfully, but these errors were encountered:
Is there an easy way to NOT allow logged in users to access the login/register pages? Once the user is logged in there should be no reason to access those pages, instead they should be redirected to the index page.('/')
Ive tried adding route redirects in the nuxt.config as well as adding a middleware to the login/register pages butt he page is accessed first for a few seconds before it gets redirected to the index page ('/').
loggedIn.ts middleware
export default defineNuxtRouteMiddleware(async (to, from) => { const user = useSupabaseUser(); if (user.value) return navigateTo('/'); });
This is not working as expected because it seems there is a few second delay on page load when user accesses the url directly and when the redirect(navigateTo) is fired.
The text was updated successfully, but these errors were encountered: