From 4fa297ac6c968f07aa1b3ab311ecaa97a7c79ddc Mon Sep 17 00:00:00 2001 From: Eugene Date: Tue, 15 Sep 2026 13:45:16 +0300 Subject: [PATCH] rm logout action in gigawear --- .../ru/shadowsparky/gigawear/data/LogoutActionImpl.kt | 10 ---------- .../kotlin/ru/shadowsparky/http/HttpModule.kt | 7 ++++++- 2 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 apps/giga-wear/client/src/main/kotlin/ru/shadowsparky/gigawear/data/LogoutActionImpl.kt diff --git a/apps/giga-wear/client/src/main/kotlin/ru/shadowsparky/gigawear/data/LogoutActionImpl.kt b/apps/giga-wear/client/src/main/kotlin/ru/shadowsparky/gigawear/data/LogoutActionImpl.kt deleted file mode 100644 index 556670b..0000000 --- a/apps/giga-wear/client/src/main/kotlin/ru/shadowsparky/gigawear/data/LogoutActionImpl.kt +++ /dev/null @@ -1,10 +0,0 @@ -package ru.shadowsparky.gigawear.data - -import org.koin.core.annotation.Factory -import ru.shadowsparky.http.domain.LogoutAction -import ru.shadowsparky.http.domain.TokenStorage - -@Factory -class LogoutActionImpl(private val tokenStorage: TokenStorage) : LogoutAction { - override suspend fun logout() { tokenStorage.clear() } -} diff --git a/libs/http-client/src/commonMain/kotlin/ru/shadowsparky/http/HttpModule.kt b/libs/http-client/src/commonMain/kotlin/ru/shadowsparky/http/HttpModule.kt index 84b9f2f..1be92b4 100644 --- a/libs/http-client/src/commonMain/kotlin/ru/shadowsparky/http/HttpModule.kt +++ b/libs/http-client/src/commonMain/kotlin/ru/shadowsparky/http/HttpModule.kt @@ -66,7 +66,12 @@ class HttpModule { newToken.toKtor() } catch (e: HttpException) { if (e.isServerFailure()) throw e - koin.getOrNull()?.logout() + val action = koin.getOrNull() + if (action == null) { + tokenStorage.clear() + } else { + action.logout() + } null } }