diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-01-25 22:49:10 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-01-25 22:49:10 -0600 |
commit | b4785c42aa026a561674257955a7c59b8c964e6f (patch) | |
tree | 1c4e3e9f74e92a222e9f0cffae0457befe39741e /shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers | |
parent | 4a85207614840d340167000e4d66649fdd462901 (diff) | |
download | etbsa-trackermap-mobile-b4785c42aa026a561674257955a7c59b8c964e6f.tar.gz etbsa-trackermap-mobile-b4785c42aa026a561674257955a7c59b8c964e6f.tar.bz2 etbsa-trackermap-mobile-b4785c42aa026a561674257955a7c59b8c964e6f.zip |
Refactored session handling into a shared SessionManager to prevent mutability and get it run in Native (untested!)
Diffstat (limited to 'shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers')
-rw-r--r-- | shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt index afa6dc2..2f196f1 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/SessionController.kt @@ -95,11 +95,9 @@ class SessionController( loginStateFlow.value = LoginState.Loading GlobalScope.launch { try { - sessionApi.baseUrl = url - usersApi.baseUrl = sessionApi.baseUrl + sessionApi.sessionManager.baseUrl = url val session = sessionApi.sessionPost(email, password) userFlow.value = session - usersApi.token = sessionApi.token token?.let { registerFcmToken(it) } loginStateFlow.value = LoginState.Success } catch (e: Exception) { |