Horrible redirect kludge to fix login flow, tidy up and readme

This commit is contained in:
Michael Dausmann
2023-01-02 20:53:04 +11:00
parent 0dbc33a145
commit edd65f1301
5 changed files with 21 additions and 19 deletions

View File

@@ -1,13 +1,6 @@
export default defineNuxtRouteMiddleware((to) => {
const user = useSupabaseUser();
if(!user.value && to.path === '/dashboard'){
console.log('auth - navigating to login (from dashboard)')
navigateTo('login');
} else if(user.value && to.path === '/') {
console.log('auth - navigating to dashboard (from root)')
navigateTo('dashboard');
} else if(user.value && to.path === '/login') {
console.log('auth - navigating to dashboard (from login)')
navigateTo('dashboard');
}
}
})