4.6 KiB
4.6 KiB
Session Handoff: Splash Page & Magic Link Login
Date: 2026-04-12 Session Duration: ~30 minutes Session Focus: Implement unauthenticated splash page with logo and login button; implement magic link login page Context Usage at Handoff: Low
What Was Accomplished
- Splash page implemented →
app/pages/index.vue— unauthenticated users see centered logo + "Log In" button; authenticated users see home content with header/menu - Login page implemented →
app/pages/login.vue— email input, sends magic link viaauth.sendMagicLink(), shows confirmation state with mail icon after send - Auth middleware updated →
app/middleware/auth.ts— added/to public routes; unauthenticated users redirected to/(not/login) - Supabase redirect config updated →
nuxt.config.ts—loginredirect changed from/loginto/;/added toexcludelist
Exact State of Work in Progress
- Splash + login pages coded but not yet tested end-to-end against local Supabase
auth/callback.vuestill a skeleton — magic link redirect will land there; not yet implemented
Decisions Made This Session
- USE
/as the unauthenticated landing route INSTEAD OF/loginBECAUSE the splash/logo page IS the unauthenticated entry point;/loginis a detail page reached from it — STATUS: confirmed - MAGIC LINK ONLY on login page (not OTP) BECAUSE user stated "sends a magic link" — STATUS: confirmed; OTP flow (
sendOtp+verifyOtp) exists in auth store but unused by login page
Key Numbers Generated or Discovered This Session
- Logo file:
public/oysqn_logo.png(confirmed present) - Max logo display width: 280px (CSS)
- Max login form width: 400px (CSS)
Files Created or Modified
| File Path | Action | Description |
|---|---|---|
app/pages/index.vue |
Modified | Splash (unauthenticated) + home (authenticated) in single page, toggled by useSupabaseUser() |
app/pages/login.vue |
Modified | Email input → sendMagicLink() → confirmation state; uses IonBackButton to return to splash |
app/middleware/auth.ts |
Modified | Added / to public routes; redirects unauthenticated to / |
nuxt.config.ts |
Modified | supabase.redirectOptions.login = /; added / to exclude |
What the NEXT Session Should Do
- First: Test the auth flow end-to-end: load app → confirm splash shows logo + Login button → tap Login → enter email → check Mailpit (http://127.0.0.1:54324) for magic link → click link → confirm redirect to
/auth/callback→ confirm redirect to/(home state) - Then: Implement
app/pages/auth/callback.vue— handle magic link redirect (Supabase sets session from URL hash; page should show a spinner, then navigate to/) - Then: Verify
useAuthStoreis auto-imported by Pinia Nuxt module (currently explicitly imported inlogin.vuewithimport { useAuthStore } from '~/stores/auth'— check if explicit import is still needed or if auto-import covers it) - Then: Run
npx supabase gen types typescript --local > app/types/supabase.tsto replace placeholder types - Then: Implement
app/pages/index.vuehome content (authenticated state) — boat list or welcome state
Open Questions Requiring User Input
- Should the login page also support OTP (enter token from email) as a fallback, or magic link only? —
sendOtp+verifyOtpexist in auth store but unused — impacts login page UI - Should
auth/callback.vueredirect to a specific page after login (e.g., boats list) or always to/? — impacts callback implementation
Assumptions That Need Validation
- ASSUMED:
@nuxtjs/ionic+@pinia/nuxtauto-importsuseAuthStore— currently explicitly imported; validate by removing explicit import and testing - ASSUMED:
sendMagicLink()in auth store correctly setsemailRedirectToto/auth/callback— validate by clicking the email link and checking where it lands - ASSUMED:
IonRouterOutlethandlesrouter-linkonIonButtoncorrectly — validate by tapping Login button in browser
Files to Load Next Session
app/pages/auth/callback.vue— primary implementation targetapp/pages/index.vue— may need home content (authenticated state) built outapp/stores/auth.ts— reference forsendMagicLinksignature and redirect URL
Dev Environment Reference
# Start local Supabase (if not running):
DOCKER_HOST=unix:///run/user/1000/podman/podman.sock npx supabase start
# Start app:
yarn dev
# Mailpit (view magic link emails):
http://127.0.0.1:54324
# Supabase Studio:
http://127.0.0.1:54323