Skip to content

fix: resets basic auth credentials (#1013)#1017

Merged
perber merged 1 commit into
mainfrom
fix/1013-resets-basic-auth-creds
May 22, 2026
Merged

fix: resets basic auth credentials (#1013)#1017
perber merged 1 commit into
mainfrom
fix/1013-resets-basic-auth-creds

Conversation

@perber

@perber perber commented May 22, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 22, 2026 13:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the auth refresh-token error handling to avoid returning HTTP 401 (which can cause browsers behind a Basic Auth reverse proxy to discard cached credentials), and adds an e2e regression test around that behavior.

Changes:

  • Change POST /api/auth/refresh-token missing/invalid-cookie response from 401 to 422.
  • Update authErrorStatus to map auth_invalid_refresh_token to 422 (instead of 401).
  • Add an e2e-proxy test to ensure refresh-token without a session cookie does not return 401.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
internal/wiki/auth/routes.go Adjusts refresh-token handler to return 422 instead of 401 when refresh cookie is missing/invalid.
internal/wiki/auth/errors.go Changes status mapping for auth_invalid_refresh_token to 422.
e2e-proxy/proxy_auth_test.go Adds an e2e regression test ensuring refresh-token without session cookie doesn’t return 401.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/wiki/auth/errors.go
Comment thread e2e-proxy/proxy_auth_test.go Outdated
@perber
perber force-pushed the fix/1013-resets-basic-auth-creds branch from b9ffdb4 to e54f7e1 Compare May 22, 2026 14:00
@perber
perber merged commit db47ebd into main May 22, 2026
6 checks passed
@perber
perber deleted the fix/1013-resets-basic-auth-creds branch May 22, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants