[Fix] Dev login requires an explicit opt-in and sandbox previews regain a development app env - #186
Merged
mrubens merged 1 commit intoJul 11, 2026
Conversation
…n and restore sandbox dev app env
Contributor
Author
|
No code issues found. See task Reviewed the explicit |
mrubens
marked this pull request as ready for review
July 11, 2026 13:30
mrubens
requested review from
brunobergher,
daniel-lxs and
mrubens
as code owners
July 11, 2026 13:30
8 tasks
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.
What changed
/auth/dev-login— the unauthenticated local-admin backdoor — now requires an explicitWEB_DEV_LOGIN_ENABLED=true(or1) opt-in on top of its existing guards (NODE_ENV !== 'production', development app env, loopback-only bind). Without the flag the route returns 404 even in a development app env.The intended dev flows keep working without manual steps:
pnpm dev(ecosystem.config.js) sets the flag for the local web app, with an operator override..roomote/environments/roomote.yaml) sets the flag on the web dev server and in.env.local, and now also guards the sandbox shell'sR_APP_ENVexport so the inlineR_APP_ENV=developmenton the dev-server commands is not clobbered by theR_APP_ENV=productionthat hosting deployments forward into sandboxes.The new env var is documented in
apps/docs/environment-variables.mdx.Why this change was made
The R_* env rename (#78) made
resolveAppEnv()read onlyR_APP_ENV, and the platform forwards its ownAPP_ENV=productioninto every sandbox asR_APP_ENV=production. Roomote-dev sandboxes therefore resolved a production app env, dev login 404'd, and delegated proof capture could no longer authenticate in live previews. Beyond restoring that flow, the app env alone is a weak gate for an admin backdoor:resolveAppEnv()falls back todevelopmentwhen unset, so a deployment that never configuresR_APP_ENVwould implicitly qualify. The explicit opt-in makes exposure a deliberate choice.How it was tested
/auth/dev-login404s whenWEB_DEV_LOGIN_ENABLEDis unset, empty,false, or0; existing tests cover the enabled path (14/14 passing).pnpm lint,pnpm check-types,pnpm --filter @roomote/docs check, and the declarative-environment schema test all pass.Impact
Deployments that implicitly resolve a development app env no longer expose the dev-login backdoor. Local
pnpm devand the dogfood sandbox environment are unaffected. Roomote sandboxes provisioned from the in-repo environment definition regain working dev login (and therefore working visual-proof capture) even when the hosting platform forwards a productionR_APP_ENV. Operator-managed environment definitions that start the web app directly must setWEB_DEV_LOGIN_ENABLED=trueto keep using dev login.Screenshots
Checklist
[Fix],[Feat],[Improve],[Refactor],[Docs], or[Chore]followed by a user-facing descriptionpnpm lintandpnpm check-typespass locallypnpm changeset