Clé d'API rendue au client reconstruit au démarrage
La clé est persistée en base locale, mais le client était reconstruit sans elle : tous les appels suivants partaient anonymes, à commencer par celui qui rapporte la configuration à afficher. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6efd67611f
commit
9e213968f5
@ -35,7 +35,11 @@ void main() async {
|
|||||||
if(localContext != null && localContext.host != null) {
|
if(localContext != null && localContext.host != null) {
|
||||||
print("we've got an local db !");
|
print("we've got an local db !");
|
||||||
print(localContext);
|
print(localContext);
|
||||||
localContext.clientAPI = new Client(localContext.host!); // retrieve instanceId from local DB
|
// La clé est persistée en base locale (`TabletAppContext.toMap`) : l'oublier ici
|
||||||
|
// reconstruisait un client anonyme au démarrage, et tous les appels suivants —
|
||||||
|
// à commencer par `deviceGetDetail` juste en dessous, qui donne la configuration
|
||||||
|
// à afficher — partaient sans identité.
|
||||||
|
localContext.clientAPI = new Client(localContext.host!, apiKey: localContext.apiKey);
|
||||||
isConfig = localContext.configuration != null;
|
isConfig = localContext.configuration != null;
|
||||||
print(localContext);
|
print(localContext);
|
||||||
print("localContext.deviceId");
|
print("localContext.deviceId");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user