Promote staging to master: seed content refresh + README fix - #49
Merged
Conversation
Replace demo seed posts with general-interest content
…fallback Google sign-in was rejecting every attempt in production with redirect_uri_mismatch. The server was sending Google a callback of http://localhost:5173/api/v1/auth/google/callback instead of the real onrender.com URL. Root cause: registerOAuthStrategies was built from `process.env.PUBLIC_ORIGIN ?? 'http://localhost:5173'` directly in routes/v1/auth.ts, bypassing the RENDER_EXTERNAL_URL fallback entirely — that logic only lived inside env.ts's resolveFileBackedSecrets(), which auth.ts never called. With PUBLIC_ORIGIN correctly left unset on Render (per its own sync: false / "only needed for a custom domain" contract), the raw process.env read was undefined and fell straight to the hardcoded default. Extracted resolvePublicOrigin() as a standalone function in env.ts, independent of the full EnvSchema, and call it from auth.ts. It has to be standalone rather than routed through loadEnv(): the full schema also requires MONGODB_URI/SESSION_SECRET, which the test harness never populates in process.env directly (those are passed to buildTestApp as explicit options), so calling loadEnv() at OAuth-route time broke five existing tests that don't need any of that to check a provider flag. New regression test builds the actual test app with GOOGLE_CLIENT_ID set, PUBLIC_ORIGIN unset, and RENDER_EXTERNAL_URL set to a fake onrender.com URL, then asserts the real redirect_uri query param on the Google redirect resolves to that URL, not localhost — reproducing the exact failure from production. Lives in its own file: configuredProviders() caches its result in a module-level singleton on first call, and oauth.test.ts's own tests are already the first callers in that module instance with no credentials configured.
fix(auth): route OAuth callback URLs through the RENDER_EXTERNAL_URL fallback
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.
Small follow-up to the P1-P6 promotion (PR #11) — two commits landed on
stagingsince:masteras still running the legacy MERN app, which stopped being true the moment PR Release: staging -> master #11 merged.Nothing else has changed since the last promotion.