Manually try authenticating mangadex logout, skip if it fails
This commit is contained in:
parent
d22b14734d
commit
464f2b01a1
1 changed files with 11 additions and 1 deletions
|
|
@ -71,7 +71,17 @@ class MangaDexLoginHelper(val authServiceLazy: Lazy<MangaDexAuthService>, val pr
|
||||||
|
|
||||||
suspend fun logout() {
|
suspend fun logout() {
|
||||||
return withIOContext {
|
return withIOContext {
|
||||||
authService.logout()
|
try {
|
||||||
|
if (isAuthenticated()) {
|
||||||
|
authService.logout()
|
||||||
|
} else {
|
||||||
|
if (refreshToken()) {
|
||||||
|
authService.logout()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
if (e is CancellationException) throw e
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue