mirror of
https://github.com/moghtech/komodo.git
synced 2026-05-06 00:18:38 -05:00
[PR #841] [MERGED] Auth error handling with status codes #5654
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/moghtech/komodo/pull/841
Author: @MP-Tool
Created: 9/11/2025
Status: ✅ Merged
Merged: 9/14/2025
Merged by: @mbecker20
Base:
1.19.4← Head:fix/auth-get-user-error-handling📝 Commits (6)
dfbf006Refactor authentication error handling to use serror::Result and status codesb7b9580Refactor error messages6dd9048Refactor authentication error handling to include status codes and improve error messages81ca3eeclean up100acb8clean2295660fmt📊 Changes
1 file changed (+3 additions, -2 deletions)
View changed files
📝
bin/core/src/api/auth.rs(+3 -2)📄 Description
Problem:
The current error handling in authentication is not optimal, as it always returns HTTP status code 500, regardless of whether no credentials were found in the header, the credentials are incorrect, or the user exists but is disabled. This prevents the client from distinguishing why authentication failed.
I noticed this problem in the browser console when navigating to the login page. Resources are being queried in the background even though we are not logged in. This would certainly be worth its own issue, but I will fix the problem piece by piece in smaller PRs.
Solution:
Similar to PR #819, I have adjusted the error handling to use different HTTP status codes and provide clearer information to the user about why authentication failed.
401 UNAUTHORIZED
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.