Skip to content

Commit

Permalink
fix(auth): logout local session after auth0 logout
Browse files Browse the repository at this point in the history
fixes #756.
  • Loading branch information
adrienjoly committed Dec 29, 2023
1 parent 21c0f23 commit 6e7299d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/lib/auth0/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ exports.makeAuthFeatures = (env) => {

getAuthenticatedUser(request) {
const oidcUser = getAuthenticatedUser(request);
if (!oidcUser) {
// @ts-ignore // session should be provided by 'express-session'
request.session?.destroy(function (err) {
if (err) {
console.error(
'[getAuthenticatedUser] error from request.session.destroy()',
err,
);
}
});
}
return oidcUser ? mapToOpenwhydUser(oidcUser) : null;
},

Expand Down

0 comments on commit 6e7299d

Please sign in to comment.