Skip to content

Commit

Permalink
include auth-token (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
mosch authored Nov 25, 2024
1 parent dbf1cfc commit 250e462
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/zudoku/src/lib/authentication/providers/auth0.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,20 @@ class Auth0AuthenticationProvider extends OpenIDAuthenticationProvider {
// so we use the IdP logout. Otherwise, just redirect the user to home
if (as.end_session_endpoint) {
const logoutUrl = new URL(as.end_session_endpoint);
// TODO: get id_token and set hint
// const { id_token } = session;
// if (id_token) {
// logoutUrl.searchParams.set("id_token_hint", id_token);
// }
const id_token = await this.getAccessToken();
if (id_token) {
logoutUrl.searchParams.set("id_token_hint", id_token);
}
logoutUrl.searchParams.set(
"post_logout_redirect_uri",
redirectUrl.toString(),
);

window.location.href = logoutUrl.toString();
} else {
const logoutUrl = new URL(`${this.issuer.replace(/\/$/, "")}/oidc/logout`);
const logoutUrl = new URL(
`${this.issuer.replace(/\/$/, "")}/oidc/logout`,
);
window.location.href = logoutUrl.toString();
}
};
Expand Down

0 comments on commit 250e462

Please sign in to comment.