-
Notifications
You must be signed in to change notification settings - Fork 0
Story 1.2: User Authentication System #3
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
Open
wiredbob
wants to merge
9
commits into
main
Choose a base branch
from
feature/story-1.2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add Supabase Auth integration with registration and login endpoints - Create authentication UI components (LoginForm, RegisterForm) - Implement auth types, schemas, and validation with Zod - Configure development server with working auth API routes - Add comprehensive authentication tests for API and components - Update shared package structure for auth services - Configure Supabase with proper redirect URLs and email settings Features implemented: - User registration with email/password validation - Secure login with JWT token generation - Authentication forms with error handling - Browser-safe environment configuration - Working dev server with simplified auth endpoints π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Complete implementation of secure user authentication with Supabase Auth: **Core Features:** - User registration with email verification - Secure login with JWT token generation - Session management with httpOnly cookies - Profile management (email, name updates) - Protected routes with authentication guards **Security Implementation:** - Password hashing via Supabase Auth - Secure token storage in httpOnly cookies with SameSite policies - Environment-aware security settings (strict for production) - Cross-origin authentication support for development - Automatic session validation and cleanup **Critical Fixes:** - Resolved browser compatibility issues by removing Node.js dependencies - Fixed session persistence across page refreshes - Standardized cookie-based authentication across all endpoints - Fixed sessionData undefined bug in session validation - Implemented hybrid localStorage + API session checking **Architecture:** - React Context API for global auth state management - Comprehensive error handling and validation with Zod schemas - Automatic token refresh every 15 minutes - Clean separation between auth types/schemas and services - Production-ready API endpoints with proper CORS configuration Addresses Story 1.2 Acceptance Criteria 1-5: β User registration with email/password validation β Secure login with JWT token generation β Password hashing with Supabase integration β Session management with secure token storage β Profile management (email, name updates) π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Remove unused AuthUser import - Fix user.name property access using Supabase user_metadata - Vercel build now passes successfully π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Resolves production 'Network error' by creating actual API endpoints: **New Vercel Functions:** - /api/auth/register - User registration with Supabase Auth - /api/auth/login - User login with secure cookie sessions - /api/auth/session - Session validation and refresh - /api/auth/logout - Session cleanup and logout - /api/profile/me - Profile management (GET/PUT) **Key Features:** - Environment-aware CORS and security settings - Secure httpOnly cookie session management - Supabase Auth integration with service role key - Comprehensive error handling and validation - Production-ready with proper TypeScript types **Fixes:** - 'Network error. Please try again.' on registration in production - Missing API endpoints that were only available in dev-server.js locally π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Resolves 500 error by adding required dependencies: - @supabase/supabase-js for API function authentication - @vercel/node for TypeScript types π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixes overly permissive CORS configuration: **Security Improvements:** - Production: No CORS header = same-origin only (most secure) - Development: Explicit localhost:5173 allow for Vite dev server - Removes wildcard '*' origin that allowed any domain **Changes Applied:** - api/auth/login.ts - Secure CORS policy - api/auth/register.ts - Secure CORS policy - api/auth/session.ts - Secure CORS policy - api/auth/logout.ts - Secure CORS policy - api/profile/me.ts - Secure CORS policy **Benefits:** - Prevents cross-origin attacks in production - Maintains development workflow compatibility - Follows security best practices for Vercel deployment π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixes broken database health endpoint caused by incorrect import paths: **Issues Fixed:** - Remove invalid import paths (../../lib/utils/supabase, ../../lib/utils/response) - Use @supabase/supabase-js directly like other API functions - Add consistent CORS security policy - Use standard response format with success/error structure **Changes:** - Replace broken utility imports with direct Supabase client creation - Add environment-aware CORS headers for security - Consistent error handling and response format - Proper environment variable validation **Result:** - /api/database/health endpoint now works in production - Consistent with other API function patterns - Secure CORS policy applied π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add AuthProvider wrapper to LoginPage tests - Update test expectations for working authentication form - Change from placeholder behavior to functional auth form testing - Tests now validate enabled form fields and real placeholders π€ Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Complete implementation of secure user authentication system using Supabase Auth with comprehensive session management and security features.
π Key Features Implemented
π Security Implementation
π Critical Technical Fixes
π Architecture Highlights
Test Plan
β Authentication Flow Testing
β Security Validation
β Cross-Browser Testing
Story Progress
Story 1.2 Acceptance Criteria Status:
Deployment Notes
Production Environment Variables Required:
SUPABASE_URL: Your Supabase project URLSUPABASE_ANON_KEY: Supabase anonymous keySUPABASE_SERVICE_ROLE_KEY: Service role key for server-side operationsNODE_ENV=production: Enables strict security policiesVercel Configuration:
π€ Generated with Claude Code