GetCurrentUser() was not checking the HTTP status code or the JSON
"status" field. GitLink returns {"status":401,"message":"无效token"}
as valid JSON, so json.Unmarshal succeeds and the function returns nil
error — making any token appear valid.
Now properly checks HTTP status code, JSON status field, and requires
"login" field in response. If login API tokens fail verification,
shows clear guidance to use private token (--token mode).
Root cause of Windows 401: login API returns session/CSRF token, not
a valid API access_token. The broken verification masked this entirely.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| auth | ||
| client | ||
| config | ||
| context | ||
| output | ||