feat(auth-stack): Local Auth Mode for Development #8339
Merged
+459
−42
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.
Implements a local-only authentication mode that completely bypasses Auth0 for local development. This eliminates the need for Auth0
credentials, internet connectivity, and the full onboarding flow, enabling developers to start working immediately with a single
environment variable.
Motivation
Previously, local development required:
This created friction for:
Complete Local Auth Flow
✅ Zero Auth0 interaction
✅ Auto-authentication (no login form)
✅ Auto-workspace creation
✅ Skip email verification
✅ Skip ToS acceptance
✅ Skip profile completion
✅ Skip onboarding modal
✅ Instant workspace access
Implementation
Single Configuration Variable:
LOCAL_AUTH_MODE=true # in bin/auth-api/.env.local
Hardcoded Local User:
Auto-Provisioned Workspace:
Bypasses:
Security & Logging
Comprehensive Logging:
All local auth operations logged with 🔧 emoji and type: "local-auth":
Auto-Detection:
Frontend auto-detects local mode by attempting /auth/local-login on auth failure. Backend rejects with 403 LocalAuthDisabled if
LOCAL_AUTH_MODE != true.
Risk Assessment
🔴 CRITICAL - Security Risks
Risk: Complete authentication bypass
Risk: Hardcoded credentials
🟡 MEDIUM - Operational Risks
Risk: Database pollution in shared environments
Risk: Environment variable misconfiguration
Risk: Backend/frontend version mismatch
🟢 LOW - Compatibility Risks
Risk: JWT token format incompatibility
Risk: Database schema drift
Production Safety Guarantees