From 25b9df478cab10dc97b2c2508e016666247c24eb Mon Sep 17 00:00:00 2001 From: Cyrus Date: Thu, 22 Jan 2026 19:54:48 +0800 Subject: [PATCH] fix(auth): normalize authMethod to lowercase on Kiro token import - Add strings.ToLower() normalization in LoadKiroIDEToken() - Add same normalization in LoadKiroTokenFromPath() - Fixes issue where Kiro IDE exports "IdC" but code expects "idc" --- internal/auth/kiro/aws.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/auth/kiro/aws.go b/internal/auth/kiro/aws.go index d266b9bf..91f7f3c1 100644 --- a/internal/auth/kiro/aws.go +++ b/internal/auth/kiro/aws.go @@ -190,6 +190,9 @@ func LoadKiroIDEToken() (*KiroTokenData, error) { return nil, fmt.Errorf("access token is empty in Kiro IDE token file") } + // Normalize AuthMethod to lowercase (Kiro IDE uses "IdC" but we expect "idc") + token.AuthMethod = strings.ToLower(token.AuthMethod) + return &token, nil } @@ -219,6 +222,9 @@ func LoadKiroTokenFromPath(tokenPath string) (*KiroTokenData, error) { return nil, fmt.Errorf("access token is empty in token file") } + // Normalize AuthMethod to lowercase (Kiro IDE uses "IdC" but we expect "idc") + token.AuthMethod = strings.ToLower(token.AuthMethod) + return &token, nil }