Skip to content

Commit

Permalink
Merge pull request #77 from synapsestudios/v1.1.9/76-logout-error
Browse files Browse the repository at this point in the history
check for `dump.account` before i try to do anything
  • Loading branch information
spruce-bruce authored Jun 7, 2017
2 parents 5d5d268 + 57553ec commit 5bfb428
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions api/src/lib/oidc-adapter/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,18 @@ module.exports = (userService) => {
const dump = JSON.parse(data.dump);
if (this.name === 'Session') {
// make sure the user still exists
return userService.findByIdForOidc(id)
.then(user => {
if (!user) {
this.destroy(id);
return undefined;
}
return dump;
});
if (dump.account) {
return userService.findByIdForOidc(dump.account)
.then(user => {
if (!user) {
this.destroy(id);
return undefined;
}
return dump;
});
}

return dump;
} else {
return dump;
}
Expand Down

0 comments on commit 5bfb428

Please sign in to comment.