Commit Graph

4 Commits

Author SHA1 Message Date
Michele
6cfe58e96d feat(01-05): add middleware for session refresh and route protection
- Create updateSession helper for Supabase session management
- Add main middleware with protected and auth route handling
- Configure matcher to exclude static files for performance
- Session refresh on every request prevents random logouts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:36:36 +01:00
Michele
d1156c7a03 feat(01-03): add validation schemas and server actions
- Add Zod validation schemas for auth operations
- Add server actions for register, login, reset, update password
- Add clsx and tailwind-merge for class utilities
- Password validation: 8+ chars, 1 number, 1 uppercase
- Error messages in Italian per user requirement
- Specific error messages (not generic 'invalid credentials')

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 05:10:33 +01:00
Michele
1d454d2fcb feat(01-04): create Google Sign-In button component
- Add cn() utility function for class name merging
- Add Button component with default/outline/ghost variants
- Add Card component with Header, Title, Description, Content, Footer
- Add GoogleSignInButton with signInWithOAuth for Google provider
- Italian text: 'Accedi con Google'
- Redirects to /auth/callback after consent

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 05:05:44 +01:00
Michele
c5b22420ac feat(01-01): create dual Supabase client pattern for App Router
- src/lib/supabase/client.ts: Browser client for Client Components
  - Uses createBrowserClient from @supabase/ssr
  - Reads NEXT_PUBLIC_* env vars

- src/lib/supabase/server.ts: Server client for SSR/Actions
  - Uses createServerClient from @supabase/ssr
  - Async cookies() for Next.js 15+ compatibility
  - Cookie handlers for session management
  - Try/catch in setAll for Server Component safety

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 03:32:14 +01:00