fix: probe all regions during auth login to prevent false validation failures#135
Open
RyanLee-Dev wants to merge 1 commit into
Open
fix: probe all regions during auth login to prevent false validation failures#135RyanLee-Dev wants to merge 1 commit into
RyanLee-Dev wants to merge 1 commit into
Conversation
…failures Closes #132. A CN key validated against the global quota endpoint returns status_code 2049, and the old catch-all replaced the real error with a generic "API key validation failed" message, hiding the root cause. Now auth login probes every region in parallel (like detectRegion) and picks the first that succeeds; on failure the actual API errors from each region are surfaced. The main.ts region-detection step is skipped for auth login since the command handles it internally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #132.
config.baseUrl. A CN key hitting the global quota endpoint returnsstatus_code: 2049, which was silently swallowed by a catch-all and replaced with a generic "API key validation failed" — the user had no way to diagnose the issue.global: API error: invalid api key; cn: API error: ...), plus a hint to use--verbose.auth login, since the command now handles it internally during key validation.Test plan
bun test— 212 pass, 0 failTesting key... Valid (cn), saves key + detected region--verboseshows full HTTP request/response for each region probe