Fix token persistency across server restarts

This fixes a regression introduced by LDAP support addition
(https://github.com/thelounge/lounge/pull/477), which forces
users to re-login when the server restarts. This was originally
implemented in https://github.com/thelounge/lounge/pull/370.
This commit is contained in:
Jérémie Astori 2016-08-10 02:26:47 -04:00
parent facf306045
commit cf64cb04c4
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ function ClientManager() {
ClientManager.prototype.findClient = function(name, token) { ClientManager.prototype.findClient = function(name, token) {
for (var i in this.clients) { for (var i in this.clients) {
var client = this.clients[i]; var client = this.clients[i];
if (client.name === name || (token && token === client.token)) { if (client.name === name || (token && token === client.config.token)) {
return client; return client;
} }
} }

View File

@ -282,11 +282,11 @@ function auth(data) {
} }
} else { } else {
client = manager.findClient(data.user, data.token); 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; var token;
if (data.remember || data.token) { if (data.remember || data.token) {
token = client.token; token = client.config.token;
} }
var authCallback = function(success) { var authCallback = function(success) {