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() }