Skip to content

Commit 00ae0a3

Browse files
committed
fix(fc): store account on true login success
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent be4da4d commit 00ae0a3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

flipchatApp/src/main/kotlin/xyz/flipchat/app/auth/AuthManager.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ class AuthManager @Inject constructor(
158158
id
159159
}
160160
.onSuccess {
161+
if (!isSoftLogin) {
162+
AccountUtils.addAccount(
163+
context = context,
164+
name = userManager.displayName.orEmpty(),
165+
password = it.base58,
166+
token = entropyB64
167+
)
168+
}
161169
userManager.set(userId = it)
162170
savePrefs()
163171
}
@@ -208,6 +216,7 @@ class AuthManager @Inject constructor(
208216
}
209217

210218
suspend fun logout(context: Context): Result<Unit> {
219+
println("Logging out")
211220
return AccountUtils.removeAccounts(context).toFlowable()
212221
.to { runCatching { it.firstOrError().blockingGet() } }
213222
.onSuccess { clearToken() }

0 commit comments

Comments
 (0)