fixed bug saving tunnel tokens

This commit is contained in:
tigerbot 2017-06-21 16:07:48 -06:00
parent 0c71b83fa5
commit 7a2f0f0984
1 changed files with 2 additions and 2 deletions

View File

@ -53,14 +53,14 @@ module.exports.create = function (deps, config) {
, save: function (token) { , save: function (token) {
return PromiseA.resolve().then(function () { return PromiseA.resolve().then(function () {
var curTokens = storage._read(); var curTokens = storage._read();
curTokens[storage._makeKey(token)] = token; curTokens[storage._makeKey(token.jwt)] = token;
return storage._write(curTokens); return storage._write(curTokens);
}); });
} }
, del: function (token) { , del: function (token) {
return PromiseA.resolve().then(function () { return PromiseA.resolve().then(function () {
var curTokens = storage._read(); var curTokens = storage._read();
delete curTokens[storage._makeKey(token)]; delete curTokens[storage._makeKey(token.jwt)];
return storage._write(curTokens); return storage._write(curTokens);
}); });
} }