-
Notifications
You must be signed in to change notification settings - Fork 0
feat(auth): implement magic link authentication with profile management #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add migration to create email and line_manager fields on profiles table - Add unique constraint on user_id for ON CONFLICT support in trigger - Create auto-profile trigger for new auth.users signups - Add RLS policies for authenticated user access - Update test data source with line_manager_name and line_manager_email - Modify data generation scripts to use simplified line manager approach - Skip old organizations and line_managers table population (backward compatible) - Update profiles via UPDATE instead of INSERT to work with trigger
- Add Supabase SSR integration with @supabase/ssr package - Create hooks.server.ts for session management via HTTP-only cookies - Implement magic link login flow with email OTP - Add auth callback handler supporting both PKCE and token_hash flows - Create ProfileCompletionModal for first-time user onboarding - Collect user name and optional line manager details on signup - Add RLS policies migration to support INSERT operations with WITH CHECK - Fix upsertResponse to use native Supabase upsert with onConflict - Remove test user selection UI and context providers - Add profile loading from authenticated session in dashboard layout - Display logged-in user name in header - Disable email button when no questions answered - Create custom branded magic link email template - Add error handling for expired/invalid magic links - Update deployment script for production auth configuration
- Update landing page to clarify login vs signup flow - Add envelope icon to "Send magic link" button for clarity - Improve landing page positioning (items-start with pt-20) - Create ProfileSettingsModal for managing user profile - Add ProfileButton to footer for accessing profile settings - Update magic link email template with brand colors and LIFT logo - Optimize email template for client compatibility (table-based layout) - Remove flexbox and margins from email template - Add consistent Tooltip components across ActionsCRUD, QuestionCard, UndoButton - Fix TypeScript implicit 'any' types in Dash.svelte - Regenerate database types with line_manager fields
|
Claude finished @AlexVOiceover's task —— View job PR Review: feat(auth): implement magic link authentication with profile managementI've completed a thorough review of this authentication implementation. Here's my comprehensive feedback: 🎯 Overall AssessmentThe implementation is well-structured and follows security best practices. The code adheres to the project's conventions as documented in CLAUDE.md, and the authentication flow is properly implemented using Supabase's SSR package with HTTP-only cookies. ✅ Code Quality & Best PracticesStrengths
Areas for Improvement
🛡️ Security ConsiderationsSecurity Analysis✅ Good Security Practices:
|
- Add DbResult<T> and DbResultMany<T> for consistent database operation return types - Add QueryOptions interface for query customization - Add FilterOptions interface for filtering operations - Fixes GitHub CI TypeScript errors about missing type exports
|
Claude finished @AlexVOiceover's task —— View job PR Review: feat(auth): implement magic link authentication with profile managementI've completed a thorough review of this authentication implementation. Here's my comprehensive feedback: 🎯 Overall AssessmentThis is a well-implemented authentication system using Supabase magic links with HTTP-only cookies. The code follows the project's documented conventions and implements security best practices. However, there are some areas that need attention, particularly around test coverage and minor security improvements. ✅ Code Quality & Best PracticesStrengths
Areas for Improvement
🛡️ Security ConsiderationsSecurity Analysis✅ Implemented Well:
|
- Cast preferences from Supabase Json type to UserPreferences in ProfileSettingsModal - Cast preferences from Supabase Json type to UserPreferences in +layout.server.ts - Add null check for question.id before checking if answered in Dash.svelte - Fixes all svelte-check TypeScript errors
|
Claude finished @AlexVOiceover's task —— View job PR Review: feat(auth): implement magic link authentication with profile managementI've completed a thorough review of this authentication implementation. Here's my comprehensive feedback: 🎯 Overall AssessmentThe implementation is well-structured and follows security best practices. The code adheres to the project's conventions as documented in CLAUDE.md, and the authentication flow is properly implemented using Supabase's SSR package with HTTP-only cookies. ✅ Code Quality & Best PracticesStrengths
Areas for Improvement
🛡️ Security ConsiderationsSecurity Analysis✅ Good Security Practices:
|
Overview
Implements production-ready authentication using Supabase magic link authentication with HTTP-only cookie sessions. Replaces the test user selection system with real user authentication, onboarding flow, and profile management.
Changes
Authentication Infrastructure
hooks.server.tsMagic Link Flow
User Onboarding
Profile Management
Database Changes
UI Improvements
Development Experience
TL;DR
For developers:
npm installto get @supabase/ssr packagesupabase startsupabase db resetAuthentication flow: