mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-14 21:18:56 +01:00
Fix Kitsu toasting "Logged in" when there is an error (#4329)
This commit is contained in:
@@ -101,14 +101,10 @@ class Kitsu(private val context: Context, id: Int) : TrackService(id) {
|
||||
}
|
||||
|
||||
override suspend fun login(username: String, password: String) {
|
||||
try {
|
||||
val token = api.login(username, password)
|
||||
interceptor.newAuth(token)
|
||||
val userId = api.getCurrentUser()
|
||||
saveCredentials(username, userId)
|
||||
} catch (e: Throwable) {
|
||||
logout()
|
||||
}
|
||||
val token = api.login(username, password)
|
||||
interceptor.newAuth(token)
|
||||
val userId = api.getCurrentUser()
|
||||
saveCredentials(username, userId)
|
||||
}
|
||||
|
||||
override fun logout() {
|
||||
|
||||
Reference in New Issue
Block a user