fixed bug saving tunnel tokens
This commit is contained in:
parent
0c71b83fa5
commit
7a2f0f0984
|
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue