Commit 2f3dfcde authored by Thierry BUGEAT's avatar Thierry BUGEAT

Tokens: Add value lastModified

parent f7b2b038
......@@ -118,6 +118,7 @@ AolReader.prototype._loginCallback = function(url) {
this.post(_url, _params, function(response) {
if (_AolReader.setToken(response)) {
response.lastModified = Math.floor(new Date().getTime() / 1000);
_AolReader._save('cache/aolreader/access_token.json', 'application/json', JSON.stringify(response));
document.body.dispatchEvent(new CustomEvent('AolReader.login.done', {"detail": response}));
_MyFeeds.log('CustomEvent : AolReader.login.done');
......@@ -179,10 +180,11 @@ AolReader.prototype.updateToken = function() {
_MyFeeds.log('CustomEvent : AolReader.getNewToken.error');
} else {
_AolReader.aolreader.token.access_token = response.access_token;
_AolReader.aolreader.token.lastModified = Math.floor(new Date().getTime() / 1000);
_AolReader._save('cache/aolreader/access_token.json', 'application/json', JSON.stringify(_AolReader.aolreader.token));
_AolReader._save('cache/aolreader/access_token.new.json', 'application/json', JSON.stringify(response));
document.body.dispatchEvent(new CustomEvent('AolReader.getNewToken.done', {"detail": response}));
_MyFeeds.log('CustomEvent : AolReader.getNewToken.done');
_MyFeeds.log('CustomEvent : AolReader.getNewToken.done', response);
}
});
}
......
......@@ -100,6 +100,7 @@ Feedly.prototype.updateToken = function() {
_MyFeeds.log('CustomEvent : Feedly.getNewToken.error');
} else {
_Feedly.feedly.token.access_token = response.access_token;
_Feedly.feedly.token.lastModified = Math.floor(new Date().getTime() / 1000);
_Feedly._save('cache/feedly/access_token.json', 'application/json', JSON.stringify(_Feedly.feedly.token));
_Feedly._save('cache/feedly/access_token.new.json', 'application/json', JSON.stringify(response));
document.body.dispatchEvent(new CustomEvent('Feedly.getNewToken.done', {"detail": response}));
......@@ -144,6 +145,7 @@ Feedly.prototype._loginCallback = function(url) {
this.post(_url, _params, function(response) {
if (_Feedly.setToken(response)) {
response.lastModified = Math.floor(new Date().getTime() / 1000);
_Feedly._save('cache/feedly/access_token.json', 'application/json', JSON.stringify(response));
document.body.dispatchEvent(new CustomEvent('Feedly.login.done', {"detail": response}));
_MyFeeds.log('CustomEvent : Feedly.login.done');
......
......@@ -84,6 +84,7 @@ TheOldReader.prototype.login = function(email, password) {
this.post(_url, _params, function(response) {
if (_TheOldReader.setToken(response)) {
response.lastModified = Math.floor(new Date().getTime() / 1000);
_TheOldReader._save('cache/theoldreader/access_token.json', 'application/json', JSON.stringify(response));
document.body.dispatchEvent(new CustomEvent('TheOldReader.login.done', {"detail": response}));
_MyFeeds.log('CustomEvent : TheOldReader.login.done');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment