mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-24 06:35:46 +00:00
Handles group plans in unauthorized error check
This commit is contained in:
parent
f544f89c3a
commit
6d076888a1
1 changed files with 5 additions and 4 deletions
|
|
@ -159,7 +159,8 @@ class ApiClientImpl(
|
|||
when (response.code) {
|
||||
401 -> {
|
||||
val path = response.request.url.encodedPath
|
||||
if (!path.contains("/user/auth/update-password")) {
|
||||
|
||||
if (!path.contains("/user/auth/update-password") && !path.contains("group-plans")) {
|
||||
val bodyStr = try {
|
||||
response.peekBody(1024).string()
|
||||
} catch (_: Exception) {
|
||||
|
|
@ -172,10 +173,10 @@ class ApiClientImpl(
|
|||
} catch (_: Exception) {
|
||||
"" to ""
|
||||
}
|
||||
|
||||
|
||||
val shouldLogout = errField.equals("missingAuthHeaders", ignoreCase = true)
|
||||
|| errField.equals("invalidCredentials", ignoreCase = true)
|
||||
|| msgField.contains("invalidCredentials", ignoreCase = true)
|
||||
|| errField.equals("invalidCredentials", ignoreCase = true)
|
||||
|| msgField.contains("invalidCredentials", ignoreCase = true)
|
||||
|| msgField.contains("Missing authentication headers", ignoreCase = true)
|
||||
|| msgField.contains("There is no account that uses those credentials", ignoreCase = true)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue