gitlink-cli/internal/auth
wbtiger a27122ab76 fix: GetCurrentUser must check HTTP status and JSON status for token verification
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>
2026-04-08 12:38:25 +08:00
..
login.go fix: GetCurrentUser must check HTTP status and JSON status for token verification 2026-04-08 12:38:25 +08:00
token_store.go feat: add Windows (x64/arm64) support 2026-04-07 10:52:56 +08:00
transport.go initial commit: gitlink-cli project 2026-04-02 16:50:00 +08:00