Skip to content

Commit

Permalink
[DSW-2124] Fix clearing tokens after logout
Browse files Browse the repository at this point in the history
  • Loading branch information
janslifka committed Nov 20, 2023
1 parent cc8d427 commit 6147202
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion engine-wizard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function loadApp(config, locale, provisioning) {
registerLocalStoragePorts(app)
registerPageUnloadPorts(app)
registerRefreshPorts(app)
registerSessionPorts(app, sessionKey)
registerSessionPorts(app, sessionKey, ['session/admin'])
registerThemePorts(app)
registerWebsocketPorts(app)
cookies.registerCookiePorts(app)
Expand Down
7 changes: 6 additions & 1 deletion engine-wizard/js/ports/session.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = function (app, sessionKey) {
module.exports = function (app, sessionKey, otherSessionKeys) {
app.ports.storeSession.subscribe(storeSession);
app.ports.clearSession.subscribe(clearSession);
app.ports.clearSessionAndReload.subscribe(clearSessionAndReload);
Expand All @@ -11,6 +11,11 @@ module.exports = function (app, sessionKey) {

function clearSession() {
localStorage.removeItem(sessionKey);
if (otherSessionKeys) {
otherSessionKeys.forEach(function (otherSessionKey) {
localStorage.removeItem(otherSessionKey)
})
}
}


Expand Down

0 comments on commit 6147202

Please sign in to comment.