From e792fc056632dc7f074a0b7f0729946e88c4d3ff Mon Sep 17 00:00:00 2001 From: Tyler Liu Date: Thu, 10 Oct 2024 09:32:59 -0700 Subject: [PATCH] Revoke should provide clientId --- packages/core/src/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 61e46437..3806fc39 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -208,12 +208,16 @@ class RingCentral implements RingCentralInterface { // nothing to revoke return; } - if (!this.rest.clientId || !this.rest.clientSecret) { - // no clientId or clientSecret, the token is from external source, cannot revoke + if (!this.rest.clientId) { + // if no clientId, the token is from external source, cannot revoke + // no clientSecret is fine, since PKCE doesn't have clientSecret return; } const temp = tokenToRevoke ?? this.token?.access_token ?? this.token?.refresh_token; - await this.restapi(null).oauth().revoke().post({ token: temp }); + await this.restapi(null) + .oauth() + .revoke() + .post({ token: temp, client_id: this.rest.clientId } as any); // todo: spec doesn't allow client_id this.token = undefined; }