Skip to content

Commit

Permalink
fix: logout
Browse files Browse the repository at this point in the history
Redirect to `client.endSessionUrl`.
  • Loading branch information
cgawron committed Mar 21, 2024
1 parent a153e9c commit 4519427
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const PREFIX = process.env.API_PREFIX || '/api';
const API_URL = process.env.API_URL;
const API_KEY = process.env.API_KEY;
const BASE_URL = process.env.BASE_URL;
const POST_LOGOUT_REDIRECT_URI = process.env.POST_LOGOUT_REDIRECT_URI || "https://ki.fh-swf.de";


// log config values to console
Expand Down Expand Up @@ -87,8 +88,8 @@ app.get('/logout', (req, res) => {
logger.debug('token', token);
if (token) {
const endSessionUrl = client.endSessionUrl({
post_logout_redirect_uri: BASE_URL,
id_token_hint: token
post_logout_redirect_uri: POST_LOGOUT_REDIRECT_URI,
client_id: CLIENT_ID,
});
res.redirect(endSessionUrl)
}
Expand Down

0 comments on commit 4519427

Please sign in to comment.