Skip to content

Commit

Permalink
fix(login): fix case where an invalid socketToken cookie would prev…
Browse files Browse the repository at this point in the history
…ent a user from ever being able to log in
  • Loading branch information
Alex Van Camp committed Mar 8, 2017
1 parent ba296cd commit 7392249
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/util/authcheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ module.exports = function (req, res, next) {
// Ensure we delete the existing cookie so that it doesn't become poisoned
// and cause an infinite login loop.
req.session.destroy(() => {
res.clearCookie('connect.sid', {path: '/'});
res.clearCookie('socketToken', {path: '/'});
res.clearCookie('socketToken', {
path: '/',
domain,
secure: config.ssl && config.ssl.enabled
});
res.redirect('/login');
});
}
Expand Down

0 comments on commit 7392249

Please sign in to comment.