Comments (4)
J'en pense plusieurs choses 😛
- Ca a existé, a un moment donné : #155 — pas pour des questions d'expiration, mais même principe
- Actuellement on a
cozy.bar.updateAccessToken
qui existe
J'élargis un peu le scope, mais c'est la même chose pour cozy-realtime ou la synchro pouchdb (pre-cozy-client, je sais pas comment c'est géré dans la dernière version) — quand le token de ces libs expirent, elles se mettent à failer sans prévenir.
Est-ce que c'est leur responsabilité de demander un nouveau token à l'app quand ca arrive, ou est-ce que c'est la responsabilité de l'app de leur fournir un nouveau token avant que l'actuel expire?
Perso j'aurais tendance à dire que c'est la responsabilité de l'app de gérer les tokens et donc de les renouveler dans les libs qui dépendent d'elles.
from cozy-bar.
Court terme
La bar ne regénère pas son token. C'est donc forcément à l'app de lui mettre à jour via le updateAccessToken
qui lui est exporté.
- L'app doit surveiller la mise à jour du token de son client et faire suivre les mises à jour à la bar
- L'app doit brancher une fonction sur le reveil de l'app (l'app repasse en avant plan) pour systématiquement vérifier l'age du token et le regénérer si besoin (histoire qu'on soit certain que la bar en ait un récent quand elle cherche à l'utiliser). On peut imaginer regénérer d'office le token s'il a dépassé 1/3 ou 1/2 de sa vie.
Cette option laisse un angle mort : Si je n'utilise pas mon app pendant une semaine, que je la réouvre et que je tente d'utiliser la bar avant que l'app n'ait eu le temps de rafraichir l'access token. Ca reste toutefois suffisamment limité pour être acceptable.
Long terme
Pouvoir injecter un cozy-client dans la bar
from cozy-bar.
Closed by #461 ?
from cozy-bar.
Pour moi oui. Après ça demande maintenant que les différentes app mettent à jour la bar et utilisent leur instance cozyClient dans l'initialisation.
@kosssi tu confirmes que c'est à fermer pour toi ?
from cozy-bar.
Related Issues (20)
- CozyBar & reactIs.isMemo ? HOT 1
- updateAccessToken should not be used with a cozy-client instance initialization HOT 2
- Why harvest is a `dep`? HOT 1
- [mobile] [websocket] this._websocked.send : null is not an object
- upgrade enzyme & enzyme adapter
- BarRight / Left / Center and Context Provider HOT 3
- Dependency Dashboard
- Why is there body,html{height:auto} in the CSS of the bar ?
- coz-bar-container should align-items center
- feat: Support lack of sprite
- We should not rely on hard coded colors
- The height of the cozy-bar should be 56px for desktop and tablet
- Remove default value from DOM
- There should be a stable dev branch for v7 HOT 1
- Fix style of "coz-bar-container"
- Is Piwik still relevant?
- Is Piwik still relevant?
- The automated release is failing 🚨
- The automated release is failing 🚨
- BarRight / BarCenter / BarLeft should use extra content
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cozy-bar.