From 290af3aacbd77d1fcb12a90e006045d2b43f20b2 Mon Sep 17 00:00:00 2001 From: bruno Date: Mon, 16 Nov 2026 22:34:28 -0500 Subject: [PATCH] =?UTF-8?q?fix(sso):=20connexion=20SSO=20via=20l'appairage?= =?UTF-8?q?=20sur=20le=20backend=20centralis=C3=A9=20(2.17.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/shaarit/core/network/AuthInterceptor.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/shaarit/core/network/AuthInterceptor.kt b/app/src/main/java/com/shaarit/core/network/AuthInterceptor.kt index 9bd1801..eff9d91 100644 --- a/app/src/main/java/com/shaarit/core/network/AuthInterceptor.kt +++ b/app/src/main/java/com/shaarit/core/network/AuthInterceptor.kt @@ -46,8 +46,12 @@ class AuthInterceptor @Inject constructor( // Still 401 after a clock-corrected retry: the secret is genuinely wrong or was // regenerated server-side. Broadcast so the UI can clear credentials and return - // to the login screen. - if (response.code == 401) { + // to the login screen — except for /api/v1/info, which is only ever called to + // verify credentials (login / pairing verification). A 401 there must NOT wipe + // the credentials: for a pairing verification it would destroy a device secret + // that the server only issues once, for a possibly transient cause (Hub role + // cache, clock). The repository decides what to keep in that case. + if (response.code == 401 && !original.url.encodedPath.endsWith("/api/v1/info")) { sessionManager.onUnauthorized() }