simplified duplicated code (#1935)
This commit is contained in:
1 parent
11dec0c80a
commit
026a1339c7
1 file changed
+5
-7
+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