feat: Implement passkey authentication with admin dashboard#18
Open
feat: Implement passkey authentication with admin dashboard#18
Conversation
Major Changes: - Replace NextAuth with WebAuthn/passkey authentication - Admin approves emails, code sent on first login attempt - Minimal Steve Jobs-inspired login UI with shake animation - Admin dashboard with user management (delete, extend, exception) - Email delivery via Resend (access codes) - Session management with JWT (15min users, 1hr admins) - User tracking (first/last login, timelines generated) Authentication Flow: 1. Admin approves email → No immediate code sent 2. User tries to login → System auto-sends code via email 3. User enters code → Registers passkey (biometric/device) 4. Future logins → Passkey only (no code needed) Admin Controls: - Approve new user emails - Extend access (+7 days) - Toggle exception (never expires) - Delete users - View audit logs Technical: - SimpleWebAuthn v13 for passkey auth - PostgreSQL with Prisma ORM - JWT sessions with jose library - Next.js 15 App Router - Fixed async params for Next.js 15 compatibility 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Major features added: - WebAuthn passkey authentication with admin dashboard - Multiple access code delivery methods (Gmail SMTP, Resend API, Push) - Admin approval workflow with email notifications - Service worker for push notifications - Enhanced security headers and CSP configuration - Webpack config fixes for Node.js built-ins Authentication: - Passkey registration and login flows - Admin login with separate authentication - User approval system with email notifications Access Code Delivery: - Gmail SMTP integration (500 emails/day free) - Resend API integration (3000 emails/month free) - Browser push notifications with VAPID keys - QR code generation for easy code sharing - Copy-to-clipboard functionality Infrastructure: - Prisma schema updates for auth models - Service worker with notification support - Webpack fallbacks for browser compatibility - Security headers for service workers - ESLint configuration updates Testing: - New test files for DAL, lineage, and resourcing - Updated integration tests for auth flows 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Complete Apple-grade design analysis covering: - Detailed screen-by-screen audit (Capture, Decide, Plan, Present, Optimize modes) - Design system consistency analysis - Data flow mapping and integration gaps - Micro-gaps documentation (alignment, typography, empty states, errors) - Interaction flow analysis with emotional journey mapping - Strategic consolidation plan for unified experience - Code-level recommendations (immediate fixes to strategic refactors) - Vision statement for product omnipresence - Priority matrix with effort/impact estimates Key findings: - Overall grade B+ (85/100), can reach A+ (95/100) with recommendations - Critical gap: /project and /estimator disconnected (no data bridge) - OptimizeMode incomplete (placeholder implementation) - PresentMode missing PDF export - Multiple type safety and navigation issues identified Includes 9 comprehensive sections with actionable code examples, priority-based implementation roadmap, and success metrics. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Transform UX_UI_AUDIT_COMPLETE.md findings into implementable strategy: 1. Holistic_Redesign_V2.md - 3-tier architecture, state unification, bridge design 2. First_Impression_Onboarding.md - Pre-login emotional strategy, A/B tests 3. Admin_Journey_V2.md - Intelligent workflows, 96% time reduction 4. Measurement_and_Experiments.md - 20 metrics, telemetry, A/B tests 5. Mermaid_System_Maps.md - 8 visual diagrams (IA, state, flows) 6. Design_Tokens_ChangeList.md - Token fixes, dark mode plan 7. PresentMode_Upgrade_Spec.md - Dynamic slides, PDF export 8. L3Selector_Enhancements.md - Search, presets, keyboard nav 9. Roadmap_and_DoD.md - 3-sprint plan with DoD Key decisions: - OptimizeMode merged into PlanMode (not removed) - UnifiedProject store replaces 3 fragmented stores - Estimator → Project bridge with chip converter - PDF export via jsPDF + html2canvas - PostHog analytics with type-safe tracking 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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
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 passwordless authentication using WebAuthn passkeys, replacing NextAuth.js with a custom authentication system.
Key Features
Authentication Flow:
Admin Dashboard:
Security & UX:
123456Technical Implementation
Database Changes
Added to User model:
exception(Boolean) - Never expires flagaccessExpiresAt(DateTime) - Access expiry timestampfirstLoginAt,lastLoginAt(DateTime) - Login trackingtimelinesGenerated(Int) - Usage trackingNew models:
Authenticator- WebAuthn credentialsEmailApproval- Approved email addresses with code hashesAuditEvent- User activity logsFiles Changed
Removed:
src/lib/auth.ts(NextAuth config)src/app/api/auth/[...nextauth]/route.tsAdded:
src/app/login/page.tsx- Minimal login UIsrc/app/admin/page.tsx- Admin dashboardsrc/lib/session.ts- JWT session managementsrc/lib/webauthn.ts- WebAuthn utilitiessrc/lib/email.ts- Resend email servicesrc/app/api/auth/begin-login/route.tssrc/app/api/auth/begin-register/route.tssrc/app/api/auth/finish-login/route.tssrc/app/api/auth/finish-register/route.tssrc/app/api/auth/admin-login/route.tssrc/app/api/admin/approve-email/route.tssrc/app/api/admin/users/route.tssrc/app/api/admin/users/[id]/route.ts(DELETE)src/app/api/admin/users/[id]/extend/route.tssrc/app/api/admin/users/[id]/exception/route.tsModified:
src/middleware.ts- Auth check with new session systemsrc/app/api/projects/route.ts- Use new session managementprisma/schema.prisma- User tracking fields + passkey modelsTesting Notes
✅ Build passes locally (
npm run build)✅ Database schema synced (
npx prisma db push)✅ All TypeScript types valid
✅ Next.js 15 async params compatibility
Environment Variables Required
🤖 Generated with Claude Code