Fix AuthenticationInterceptor calling getAuthHeader twice

This commit is contained in:
Kirill Kamakin
2022-04-05 22:25:51 +05:00
parent b129913a82
commit d1578afab9
2 changed files with 123 additions and 0 deletions

View File

@@ -20,6 +20,8 @@ class AuthenticationInterceptor @Inject constructor(
val response = proceedWithAuthHeader(chain, currentHeader)
if (listOf(401, 403).contains(response.code)) {
authRepo.invalidateAuthHeader(currentHeader)
} else {
return response
}
val newHeader = authHeader ?: return response
return proceedWithAuthHeader(chain, newHeader)