feat: add DEV_MODE_BYPASS_AUTH to skip OAuth for local development#36
Draft
thejacket wants to merge 1 commit intoocrbase-hq:mainfrom
Draft
feat: add DEV_MODE_BYPASS_AUTH to skip OAuth for local development#36thejacket wants to merge 1 commit intoocrbase-hq:mainfrom
thejacket wants to merge 1 commit intoocrbase-hq:mainfrom
Conversation
Auto-provisions a deterministic dev user and signs them in via GET /v1/auth/dev-session. Login page probes the server on mount and only shows the bypass button when dev mode is active. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
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
DEV_MODE_BYPASS_AUTH=trueserver env vardev@ocrbase.local) and signs them in viaGET /v1/auth/dev-sessionWhy
Setting up GitHub OAuth (creating an app, configuring callback URLs, managing secrets) is unnecessary friction for:
Tools like Grafana, Metabase, and Portainer solve this with similar bypass mechanisms.
Safety guards
NODE_ENV=production; the endpoint is never registeredfalse, must be explicitly set to"true"WARNline is logged on every server startup when active:Configuration
# In apps/server/.env DEV_MODE_BYPASS_AUTH=trueFiles changed
packages/env/src/server.tsDEV_MODE_BYPASS_AUTHto server env schemapackages/auth/src/index.tsapps/server/src/index.tsapps/server/src/modules/auth/index.tsGET /v1/auth/dev-sessionendpointapps/web/src/routes/login.tsxapps/web/src/routes/_authenticated.tsxapps/server/.env.exampledocker-compose.ymlDEV_MODE_BYPASS_AUTHto prod serviceWhat this does NOT change
This PR only touches auth bootstrapping. No changes to:
Test plan
bun check-typespassesDEV_MODE_BYPASS_AUTH=true— login page shows bypass button, clicking it signs in and redirects to/appDEV_MODE_BYPASS_AUTHunset — login page shows only GitHub button, no/v1/auth/dev-sessionrequests in Network tab (except the initial probe returning 404)NODE_ENV=productionwith flag set — flag is ignored, endpoint returns 404