Skip to content

Commit 4be4734

Browse files
Merge pull request #3889 from bcgov/NDT-754-Keycloak-Updates-Portal
chore: update logout for new kc version
2 parents def35cb + 43bef80 commit 4be4734

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## [1.246.1](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.246.0...v1.246.1) (2025-03-11)
2+
13
# [1.246.0](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.245.0...v1.246.0) (2025-03-05)
24

35
### Features

app/backend/lib/logout.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ const siteminderUrl = config.get('SITEMINDER_LOGOUT_URL');
1212
const logout = Router();
1313

1414
logout.post('/api/logout', async (req: any, res) => {
15+
const idToken = req?.session?.tokenSet?.id_token;
1516
req.logout(() => {
1617
const idp = req.claims?.identity_provider;
1718
const baseRoute = idp === 'idir' ? '/analyst' : '/';
1819

19-
const logoutUrl = `${siteminderUrl}?retnow=1&returl=${authServerUrl}/protocol/openid-connect/logout?redirect_uri=${encodeURI(
20-
`${baseUrl}${baseRoute}`
21-
)}`;
20+
const keycloakLogoutUrl = `${authServerUrl}/protocol/openid-connect/logout?id_token_hint=${encodeURIComponent(idToken)}&post_logout_redirect_uri=${encodeURIComponent(`${baseUrl}${baseRoute}`)}`;
21+
const logoutUrl = `${siteminderUrl}?retnow=1&returl=${encodeURIComponent(keycloakLogoutUrl)}`;
2222

2323
req.session.destroy(() => {
2424
res.clearCookie('analyst.sort');

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CONN-CCBC-portal",
3-
"version": "1.246.0",
3+
"version": "1.246.1",
44
"main": "index.js",
55
"repository": "https://github.com/bcgov/CONN-CCBC-portal.git",
66
"author": "Romer, Meherzad CITZ:EX <[email protected]>",

0 commit comments

Comments
 (0)