Skip to content

Commit

Permalink
Merge pull request thelounge#570 from thelounge/astorije/569-fix-auth
Browse files Browse the repository at this point in the history
Make sure users with wrong tokens are locked out instead of crashing the app
  • Loading branch information
xPaw authored Aug 21, 2016
2 parents a193186 + 7643533 commit 782ed84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ function auth(data) {
}
} else {
client = manager.findClient(data.user, data.token);
var signedIn = data.token && data.token === client.config.token;
var signedIn = data.token && client && data.token === client.config.token;
var token;

if (data.remember || data.token) {
if (client && (data.remember || data.token)) {
token = client.config.token;
}

Expand Down

0 comments on commit 782ed84

Please sign in to comment.