fix(auth): use standard 'Unauthorized' error in hybrid auth responses#3850
Conversation
PR SummaryLow Risk Overview Written by Cursor Bugbot for commit fa62e38. Configure here. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR standardizes the 401 error messages in
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Incoming Request] --> B{Bearer token present?}
B -- Yes --> C[verifyInternalToken]
C -- Valid --> D[Return success: INTERNAL_JWT]
C -- Invalid --> E[Try session]
B -- No --> E
E --> F{Session found?}
F -- Yes --> G[Return success: SESSION]
F -- No --> H{checkHybridAuth only: x-api-key header?}
H -- Yes --> I[authenticateApiKeyFromHeader]
I -- Valid --> J[Return success: API_KEY]
I -- Invalid --> K["Return { success: false, error: 'Invalid API key' }"]
H -- No --> L["Return { success: false, error: 'Unauthorized' }"]
Reviews (1): Last reviewed commit: "fix(auth): use standard 'Unauthorized' e..." | Re-trigger Greptile |
fa62e38 to
7a42e29
Compare
Summary
Type of Change
Testing
Tested manually
Checklist