diff --git a/app/middleware/auth.ts b/app/middleware/auth.ts index e7b874c..cd45f64 100644 --- a/app/middleware/auth.ts +++ b/app/middleware/auth.ts @@ -1,10 +1,10 @@ export default defineNuxtRouteMiddleware((to) => { const user = useSupabaseUser() - const publicRoutes = ['/login', '/signup', '/auth/callback'] + const publicRoutes = ['/', '/login', '/signup', '/auth/callback'] if (publicRoutes.includes(to.path)) return if (!user.value) { - return navigateTo('/login') + return navigateTo('/') } }) diff --git a/app/pages/index.vue b/app/pages/index.vue index aa5728e..c24964b 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -1,22 +1,65 @@ - - - - - - Home - - - - Welcome to OYS Borrow a Boat - + + + + + + Log In + + + + + + + + + + + + Home + + + + Welcome to OYS Borrow a Boat + + + + diff --git a/app/pages/login.vue b/app/pages/login.vue index 92c72ef..75f389b 100644 --- a/app/pages/login.vue +++ b/app/pages/login.vue @@ -2,17 +2,114 @@ + + + Sign In - + + + Enter your email address and we'll send you a sign-in link. + + + Email address + + + + + + Send Sign-In Link + + {{ error }} + + + + + + Check your email + A sign-in link was sent to {{ email }}. Open it on this device to sign in. + + Use a different email + + + + + + diff --git a/nuxt.config.ts b/nuxt.config.ts index e21cb1b..2e7cb57 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -52,9 +52,9 @@ export default defineNuxtConfig({ supabase: { redirectOptions: { - login: '/login', + login: '/', callback: '/auth/callback', - exclude: ['/login', '/signup', '/auth/callback'], + exclude: ['/', '/login', '/signup', '/auth/callback'], }, },
Enter your email address and we'll send you a sign-in link.
{{ error }}
A sign-in link was sent to {{ email }}. Open it on this device to sign in.