Skip to content

Commit 5446c7c

Browse files
authored
Fix Exclude empty value from verifyIdToken (#691)
fixed #690
1 parent 370c919 commit 5446c7c

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

lib/client.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -867,12 +867,19 @@ export class OAuth {
867867
nonce?: string,
868868
user_id?: string,
869869
): Promise<Types.VerifyIDToken> {
870-
return this.http.postForm(`${OAUTH_BASE_PREFIX_V2_1}/verify`, {
870+
const body: { [key: string]: string } = {
871871
id_token,
872872
client_id,
873-
nonce,
874-
user_id,
875-
});
873+
};
874+
875+
if (nonce) {
876+
body.nonce = nonce;
877+
}
878+
879+
if (user_id) {
880+
body.user_id = user_id;
881+
}
882+
return this.http.postForm(`${OAUTH_BASE_PREFIX_V2_1}/verify`, body);
876883
}
877884

878885
public issueChannelAccessTokenV2_1(

0 commit comments

Comments
 (0)