frontend: Fix /auth proxy path for OIDC callback and enforce LF line endings#6103
frontend: Fix /auth proxy path for OIDC callback and enforce LF line endings#6103jooskim wants to merge 2 commits into
Conversation
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jooskim The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @jooskim! |
/auth is a React route that the Go backend's /oidc-callback handler redirects users to after a successful OIDC login. Without the trailing slash in the dev proxy config, requests to /auth (and sub-paths like /auth/...) were being forwarded to the backend instead of being served by the frontend, resulting in 404s after the OIDC callback. Also adds the Apache license header to rsbuild.config.ts and normalises minor style inconsistencies between the two config files.
Add .gitattributes rules so Git normalises *.ts, *.tsx, *.js, *.jsx, and *.json to LF on checkout, matching the existing *.go rule. Also converts vite.config.ts from CRLF to LF to align with the new policy.
b4fa23b to
1d55ee2
Compare
skoeva
left a comment
There was a problem hiding this comment.
hi - could you sign the CLA so the PR is ready to review?
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jooskim The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This PR updates the frontend dev-server proxy configuration to avoid incorrectly proxying the /auth React route during the OIDC callback flow, and adds .gitattributes rules to enforce LF line endings for common JS/TS/JSON file types.
Changes:
- Update Vite and Rsbuild dev proxy rules to proxy
/auth/(and subpaths) but not the/authSPA route. - Add
.gitattributesentries to force LF EOLs for*.ts,*.tsx,*.js,*.jsx,*.json. - Normalize
frontend/vite.config.tsline endings (CRLF → LF) as part of the new EOL policy.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| frontend/vite.config.ts | Adjusts dev proxy key from /auth to /auth/ and normalizes file formatting/EOLs. |
| frontend/rsbuild.config.ts | Updates rsbuild proxy path filter from /auth to /auth/ (and refactors formatting/header). |
| .gitattributes | Enforces LF line endings for additional frontend file types. |
| import react from '@vitejs/plugin-react'; | ||
| import { defineConfig } from 'vite'; | ||
| import { nodePolyfills } from 'vite-plugin-node-polyfills'; | ||
| import { viteStaticCopy } from "vite-plugin-static-copy"; |
| *.go text eol=lf | ||
| *.ts text eol=lf | ||
| *.tsx text eol=lf | ||
| *.js text eol=lf | ||
| *.jsx text eol=lf | ||
| *.json text eol=lf |
|
Hello @skoeva , I am currently in the process of going through the CLA process with my employer. I will get back with an update as soon as possible, thanks! |
Summary
Fix the local dev proxy so the OIDC login flow completes without 404s, and enforce LF line endings for TypeScript/JavaScript/JSON files.
Related Issue
N/A
Changes
frontend/rsbuild.config.ts/frontend/vite.config.ts: Change the proxy key for the auth route from/authto/auth/./authis a React route that the Go backend's/oidc-callbackhandler redirects users to after a successful OIDC login. Without the trailing slash, the dev proxy was matching/authas a prefix path and forwarding it to the backend instead of serving the frontend bundle, resulting in 404s after the OIDC callback..gitattributes: Addtext eol=lfrules for*.ts,*.tsx,*.js,*.jsx, and*.json, matching the existing rule for*.go. This is to enforce consistent EOL rules across the entire stack.frontend/vite.config.ts: Convert from CRLF to LF to align with the new.gitattributespolicy.Steps to Test
npm run frontend)./oidc-callbackredirect lands on the/authReact route without a 404.Screenshots
OIDC callback ends up hitting 404s without
/authproxy prefixNotes for the Reviewer
The root cause was that Vite and rsbuild both treat proxy keys without a trailing slash as exact-match routes, not prefix matches. Adding
/makes them proxy only requests whose path starts with/auth/, leaving the bare/authReact route to be served by the dev server as intended.