Skip to content

frontend: Fix /auth proxy path for OIDC callback and enforce LF line endings#6103

Open
jooskim wants to merge 2 commits into
kubernetes-sigs:mainfrom
jooskim:bugfix/jooskim/local-dev-auth-proxy-prefix
Open

frontend: Fix /auth proxy path for OIDC callback and enforce LF line endings#6103
jooskim wants to merge 2 commits into
kubernetes-sigs:mainfrom
jooskim:bugfix/jooskim/local-dev-auth-proxy-prefix

Conversation

@jooskim

@jooskim jooskim commented Jun 19, 2026

Copy link
Copy Markdown

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 /auth to /auth/. /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, the dev proxy was matching /auth as a prefix path and forwarding it to the backend instead of serving the frontend bundle, resulting in 404s after the OIDC callback.
  • .gitattributes: Add text eol=lf rules 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 .gitattributes policy.

Steps to Test

  1. Configure an OIDC provider in Headlamp and start the frontend dev server (npm run frontend).
  2. Initiate the OIDC login flow.
  3. Confirm the /oidc-callback redirect lands on the /auth React route without a 404.

Screenshots

OIDC callback ends up hitting 404s without /auth proxy prefix

image

Notes 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 /auth React route to be served by the dev server as intended.

@k8s-ci-robot k8s-ci-robot requested review from sniok and yolossn June 19, 2026 18:00
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 19, 2026

Copy link
Copy Markdown

CLA Not Signed

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jooskim
Once this PR has been reviewed and has the lgtm label, please assign yolossn for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Welcome @jooskim!

It looks like this is your first PR to kubernetes-sigs/headlamp 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/headlamp has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 19, 2026
jooskim added 2 commits June 19, 2026 11:33
/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.
@jooskim jooskim force-pushed the bugfix/jooskim/local-dev-auth-proxy-prefix branch from b4fa23b to 1d55ee2 Compare June 19, 2026 18:33
@jooskim jooskim changed the title frontend: Fix /auth proxy path and enforce LF line endings frontend: Fix /auth proxy path for OIDC callback and enforce LF line endings Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants