Let Google sign-in trust the port the app actually uses - #22
Open
krongggggg wants to merge 1 commit into
Open
Conversation
When TRUSTED_ORIGINS is unset, the API now accepts http://localhost:3010, which is where start.sh serves the app. The old fallback was port 3000, so a clone that enabled Google sign-in without setting the variable was rejected for the origin it was actually served from. Co-authored-by: krong <krongggggg@gmail.com>
krongggggg
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso and
tylerslaton
as code owners
August 20, 2026 02:34
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 this changes
When Google sign-in is enabled and
TRUSTED_ORIGINSis unset, the API now acceptshttp://localhost:3010— the originstart.shactually serves. The old fallback was port 3000, so a clone that copied.env.example, started the stack, and wired Google OAuth could be rejected for an origin it was never served from.Deriving the default from
BETTER_AUTH_URLwould still be wrong: that URL is the API (3001), not the app.The README no longer warns about a 3000-vs-3010 footgun.
docs/configuration.mdrecords the new default..env.examplealready set 3010 and is unchanged.Where it runs
Boundary and audit
Proof
bun run format/format:check— cleanbun run lint— exit 0bun run typecheck— app, server and worker all exit 0bun test server/tests/config.test.ts— 19 pass, 0 failbun run build— app, server and worker all exit 0Test plan
TRUSTED_ORIGINS, runscripts/start.sh, and confirm the app originhttp://localhost:3010is acceptedTRUSTED_ORIGINSto a custom origin and confirm that still wins over the default