Merge pull request #553 from thelounge/astorije/fix-auth-token
Fix token persistency across server refresh
This commit is contained in:
commit
11654ff3c1
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user