fix: detect Vite port for TanStack Start and validate redirect URI port#185
Closed
nicknisi wants to merge 1 commit into
Closed
fix: detect Vite port for TanStack Start and validate redirect URI port#185nicknisi wants to merge 1 commit into
nicknisi wants to merge 1 commit into
Conversation
detectPort now reads vite.config.{ts,js,mjs} for tanstack-start (modern
@tanstack/react-start is Vite-based), falling back to legacy Vinxi
app.config.ts, and the shared react/react-router/vanilla-js Vite loop is
extracted into a parseViteConfigPortFromDir helper.
Redirect-URI validators (Next.js, React Router, TanStack Start) now compare
the URI's effective port to the detected dev-server port for local hosts and
push an error-severity issue on mismatch, flipping validation to failed
instead of silently passing. Route-mismatch hints use the redirect URI's real
origin instead of a hardcoded localhost:3000.
Fixes the Akshay friction-log trust failure where a Lovable TanStack Start
app on port 8080 was configured against localhost:3000 yet certified as
"Validation passed".
Member
Author
|
Closing in favor of a single combined PR from nicknisi/akshay. |
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
detectPortnow parsesvite.config.{ts,js,mjs}first for TanStack Start projects (via a sharedparseViteConfigPortFromDirhelper), falling back to the legacyapp.config.tsparsing.WORKOS_REDIRECT_URIport against the detected dev port on local hosts and report a mismatch as a validation error — "Validation passed" no longer renders over a broken install.localhost:3000.Why
From Akshay Maniyar's AuthKit friction log: on a Lovable-style TanStack Start app (Vite dev server on 8080, port configured only in
vite.config.ts), the installer wrote port 3000 into.env.localand the dashboard (redirect URI, CORS origins, homepage), then reported "Validation passed" because the validators parsed the redirect URI and discarded the port. Login redirected to a dead port with a green checkmark on the install.Testing
port-detection.spec.tsfixture cases for the vite.config shape (ts/js/mjs, legacy app.config precedence preserved).pnpm build && pnpm test && pnpm typecheckgreen.Stack 1/7 (
akshay-friction-log): this is the base PR — merges directly tomain. The rest of the stack follows.