Hi! I'm using `io.ktor.client.plugins.auth`, and i...
# ktor
a
Hi! I'm using
io.ktor.client.plugins.auth
, and it has a method
fun HttpRequestBuilder.markAsRefreshTokenRequest()
. Its description is: "Marks that this request is for refreshing auth tokens, resulting in a special handling of it." Could someone explain what this method actually does? What does "special handling of it" mean?
a
It prevents an indefinite loop within the
refreshTokens
lambda when the client gets a 401 response from the server while refreshing the token.
a
So, if I get a 401 response from a refresh token HTTP call, and if I use
markAsRefreshTokenRequest()
, does it prevent an indefinite loop?
a
Yes, it should
thank you color 1