How do you reset the auth tokens previously passed...
# ktor
n
How do you reset the auth tokens previously passed to
install(Auth) { bearer { ... } }
? We're having serious issues after logout/re-login, because apparently ktor keeps the old token in memory (loadTokens / refreshTokens not called). Using ktor client 1.6.0.
Ok I found it -
Copy code
client[Auth].providers.filterIsInstance<BearerAuthProvider>().forEach {
    it.clearToken()
}
r
there is a bug in 1.6.0 that prevents tokens from being re-requested. fixed in 1.6.3
n
You mean after 401? The code above seemed to solve my issue, but I'll upgrade anyway. Thanks!
👍 1
r
Some versions prior to 1.6.3 were not updating token after calling to
clearToken