Skip to content

Commit 133e942

Browse files
committed
Resolve OAuth token payload
1 parent 9f472c3 commit 133e942

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

run.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,14 @@ func ServiceAccountAccessToken() string {
278278
if err != nil {
279279
return "local-access-token"
280280
}
281-
return token
281+
282+
var object map[string]any
283+
err = json.Unmarshal([]byte(token), &object)
284+
if err != nil {
285+
return "no-token-found"
286+
}
287+
288+
return object["access_token"].(string)
282289
}
283290

284291
// AddOAuth2Header injects an `Authorization` header with a valid access token

0 commit comments

Comments
 (0)