mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
simplified duplicated code (#1935)
This commit is contained in:
+5
-7
@@ -545,13 +545,11 @@ func parseTokenResponse(body []byte, provider string) (*AuthCredential, error) {
|
||||
AuthMethod: "oauth",
|
||||
}
|
||||
|
||||
if accountID := extractAccountID(tokenResp.IDToken); accountID != "" {
|
||||
cred.AccountID = accountID
|
||||
} else if accountID := extractAccountID(tokenResp.AccessToken); accountID != "" {
|
||||
cred.AccountID = accountID
|
||||
} else if accountID := extractAccountID(tokenResp.IDToken); accountID != "" {
|
||||
// Recent OpenAI OAuth responses may only include chatgpt_account_id in id_token claims.
|
||||
cred.AccountID = accountID
|
||||
// Recent OpenAI OAuth responses may only include chatgpt_account_id in id_token claims.
|
||||
if id := extractAccountID(tokenResp.IDToken); id != "" {
|
||||
cred.AccountID = id
|
||||
} else if id := extractAccountID(tokenResp.AccessToken); id != "" {
|
||||
cred.AccountID = id
|
||||
}
|
||||
|
||||
return cred, nil
|
||||
|
||||
Reference in New Issue
Block a user