Skip to content

Commit

Permalink
set id_token_hint in search params when logging out if avaible
Browse files Browse the repository at this point in the history
  • Loading branch information
KristianRykkje committed Aug 29, 2024
1 parent aa68b34 commit ecdeb4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/auth0-session/client/edge-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/auth0-session/client/node-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ecdeb4c

Please sign in to comment.