Skip to content

Commit

Permalink
Merge pull request thelounge#553 from thelounge/astorije/fix-auth-token
Browse files Browse the repository at this point in the history
Fix token persistency across server refresh
  • Loading branch information
maxpoulin64 authored Aug 11, 2016
2 parents e1daddb + 22cf600 commit 5684a92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/clientManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function ClientManager() {
ClientManager.prototype.findClient = function(name, token) {
for (var i in this.clients) {
var client = this.clients[i];
if (client.name === name || (token && token === client.token)) {
if (client.name === name || (token && token === client.config.token)) {
return client;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ function auth(data) {
}
} else {
client = manager.findClient(data.user, data.token);
var signedIn = data.token && client && client.token === data.token;
var signedIn = data.token && data.token === client.config.token;
var token;

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

var authCallback = function(success) {
Expand Down

0 comments on commit 5684a92

Please sign in to comment.