From ecdeb4cd554f6c95fc6032d99f512f5d7f1fbe80 Mon Sep 17 00:00:00 2001 From: KristianRykkje Date: Thu, 29 Aug 2024 10:07:07 +0200 Subject: [PATCH] set id_token_hint in search params when logging out if avaible --- src/auth0-session/client/edge-client.ts | 1 + src/auth0-session/client/node-client.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/auth0-session/client/edge-client.ts b/src/auth0-session/client/edge-client.ts index 371f6ecf..3887740f 100644 --- a/src/auth0-session/client/edge-client.ts +++ b/src/auth0-session/client/edge-client.ts @@ -196,6 +196,7 @@ export class EdgeClient extends AbstractClient { const { id_token_hint, post_logout_redirect_uri, ...extraParams } = parameters; const auth0LogoutUrl: URL = new URL(urlJoin(as.issuer, '/v2/logout')); post_logout_redirect_uri && auth0LogoutUrl.searchParams.set('returnTo', post_logout_redirect_uri); + id_token_hint && auth0LogoutUrl.searchParams.set('id_token_hint', id_token_hint); auth0LogoutUrl.searchParams.set('client_id', this.config.clientID); Object.entries(extraParams).forEach(([key, value]: [string, string]) => { if (value === null || value === undefined) { diff --git a/src/auth0-session/client/node-client.ts b/src/auth0-session/client/node-client.ts index d7f1f8d7..c0eaaced 100644 --- a/src/auth0-session/client/node-client.ts +++ b/src/auth0-session/client/node-client.ts @@ -151,6 +151,7 @@ export class NodeClient extends AbstractClient { const parsedUrl = new URL(urlJoin(issuer.metadata.issuer, '/v2/logout')); parsedUrl.searchParams.set('client_id', config.clientID); post_logout_redirect_uri && parsedUrl.searchParams.set('returnTo', post_logout_redirect_uri); + id_token_hint && parsedUrl.searchParams.set('id_token_hint', id_token_hint); Object.entries(extraParams).forEach(([key, value]) => { if (value === null || value === undefined) { return;