@@ -572,7 +572,6 @@ func getCurrentUserId(cfg config, httpClient *http.Client) (string, error) {
572
572
573
573
req .Header .Set ("Authorization" , "Bearer " + cfg .token )
574
574
req .Header .Set ("Accept" , "application/json" )
575
- req .Header .Set ("X-AXIOM-ORG-ID" , cfg .orgID )
576
575
577
576
resp , err := httpClient .Do (req )
578
577
if err != nil {
@@ -589,17 +588,18 @@ func getCurrentUserId(cfg config, httpClient *http.Client) (string, error) {
589
588
if err != nil {
590
589
return "" , fmt .Errorf ("failed to read response body: %w" , err )
591
590
}
592
-
593
- var userResponse map [string ]interface {}
591
+ var userResponse struct {
592
+ ID string `json:"id"`
593
+ }
594
594
if err := json .Unmarshal (body , & userResponse ); err != nil {
595
595
return "" , fmt .Errorf ("failed to parse user response: %w" , err )
596
596
}
597
597
598
- if userID , ok := userResponse [ "id" ].( string ); ok && userID ! = "" {
599
- return userID , nil
598
+ if userResponse . ID = = "" {
599
+ return "" , fmt . Errorf ( "user ID not found in response" )
600
600
}
601
601
602
- return "" , fmt . Errorf ( "user ID not found in response" )
602
+ return userResponse . ID , nil
603
603
}
604
604
605
605
// newGetQueryHistoryHandler creates a handler for retrieving query execution history from axiom-history dataset
0 commit comments