Attention ! Gitlab fournissant maintenant nativement des certificats Let’s Encrypt aux domaines personnalisés des Gitlab Pages, nous avons coupé notre service qui le faisait automatiquement pour vous.

Il est impératif, pour que votre domaine personnalisé continue à avoir un certificat Let’s Encrypt à jour, d’activer la fonctionnalité native dans les paramètres de votre projet. Cette activation remplacera votre certificat actuel par un nouveau certificat Let’s Encrypt géré par Gitlab.

Voir les détails sur https://docs.framasoft.org/fr/gitlab/gitlab-pages-le.html

Commit f8dd2d49 authored by Thierry BUGEAT's avatar Thierry BUGEAT

#25 Renew Feedly token when app start

parent dcbc5dc1
......@@ -50,3 +50,4 @@ confirm-delete-keyword=Are you sure you want delete this keyword ?
confirm-add-keyword=Are you sure you want add this keyword ?
keyword-was-added=Keyword was added.
keyword-was-not-added=Keyword was not added.
feedly-get-subscriptions-error=Feedly error:
......@@ -50,3 +50,4 @@ confirm-delete-keyword=¿Esta seguro de querer borrar esta palabra clave?
confirm-add-keyword=¿Esta seguro de quere añadir esta palabra clave?
keyword-was-added=La palabra clave ha sido añadida.
keyword-was-not-added=La palabra clave no ha sido añadida.
feedly-get-subscriptions-error=Feedly error:
......@@ -50,3 +50,4 @@ confirm-delete-keyword=Voulez-vous vraiment effacer ce mot clé ?
confirm-add-keyword=Voulez-vous vraiment ajouter ce mot clé ?
keyword-was-added=Le mot clé a été ajouté.
keyword-was-not-added=Le mot clé n'a pas été ajouté.
feedly-get-subscriptions-error=Erreur Feedly:
......@@ -49,3 +49,4 @@ confirm-delete-keyword=Are you sure you want delete this keyword ?
confirm-add-keyword=Are you sure you want add this keyword ?
keyword-was-added=Keyword was added.
keyword-was-not-added=Keyword was not added.
feedly-get-subscriptions-error=Feedly erro:
......@@ -124,7 +124,7 @@
ui.selectThemeIcon();
// Get and set Feedly token from cache
// Get and set Feedly token from cache then try to update token.
if (params.accounts.feedly.logged) {
my._load('cache/feedly/access_token.json').then(function(_token){
feedly.setToken(_token);
......@@ -134,6 +134,13 @@
}).catch(function(error) {
my.alert("Can't load and set Feedly token");
_disableAccount('feedly');
}).then(function(){
if (navigator.onLine) {
my.log("Try to update Feedly token...");
feedly.updateToken();
}
}).catch(function(error) {
my.log("Can't update Feedly token");
});
}
// Get and set The Old Reader token from cache
......@@ -747,7 +754,7 @@
document.getElementById('appVersion').onclick = function(e) {
params.settings.developper_menu.visible = !params.settings.developper_menu.visible;
dspSettings();
window.alert('Developper menu : ' + params.settings.developper_menu.visible);
my.message('Developper menu : ' + params.settings.developper_menu.visible);
_saveParams();
}
......@@ -1844,7 +1851,7 @@
}
}
//window.alert(_nextEntryId+ ' [<] '+ _entryId +' [>]' +_previousEntryId);
//my.message(_nextEntryId+ ' [<] '+ _entryId +' [>]' +_previousEntryId);
// [<]
......@@ -1975,9 +1982,9 @@
// Done
window.alert(document.webL10n.get('keyword-was-added'));
my.message(document.webL10n.get('keyword-was-added'));
} else {
window.alert(document.webL10n.get('keyword-was-not-added'));
my.message(document.webL10n.get('keyword-was-not-added'));
}
}
......@@ -2128,7 +2135,7 @@
document.body.addEventListener('Feedly.getSubscriptions.error', function(response) {
my.log('CustomEvent : Feedly.getSubscriptions.error', arguments);
my.message('Feedly error');
my.message(document.webL10n.get('feedly-get-subscriptions-error') + response.detail.message);
});
/* ============================= */
......
......@@ -78,6 +78,31 @@ Feedly.prototype.getToken = function() {
return this.feedly.token;
}
/**
* Use "refresh_token" to obtain a new "access_token"
* @param {null}
* @return {CustomEvent} Feedly.getNewToken.done | Feedly.getNewToken.error
* */
Feedly.prototype.updateToken = function() {
_MyFeeds.log('Feedly.prototype.getNewToken()');
var _url = _Feedly.feedly.host + '/v3/auth/token';
var _params = 'refresh_token=' + encodeURIComponent(_Feedly.feedly.token.refresh_token) +
'&client_id=' + encodeURIComponent(_Feedly.feedly.client_id) +
'&client_secret=' + encodeURIComponent(_Feedly.feedly.client_secret) +
'&grant_type=refresh_token';
this.post(_url, _params, function(response) {
_Feedly.feedly.token.access_token = response.access_token;
_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}));
_MyFeeds.log('CustomEvent : Feedly.getNewToken.done');
});
}
/**
* @param {null}
* @return {CustomEvent} Feedly.login.done | Feedly.login.error
......
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