Is there a way to tell the Ktor client bearer auth...
# ktor
s
Is there a way to tell the Ktor client bearer auth to bust its cache for
loadTokens
? Right now: 1. The user taps log in 2.
loadTokens
gets called for the login request and returns null 3. Login succeeds and the tokens are stored to the underlying mechanism 4. The next request that gets made doesn't include the new access token because
loadTokens
doesn't get called again to see the new tokens 5. The server returns an unnecessary 401 6.
refreshTokens
gets called, which checks for
oldTokens
being null and attempts to reload from local storage instead of calling the refresh API 7. The failed API call gets retried, this time with the token included Ideally either
loadTokens
wouldn't be cached or there would be some method to call on the client to say "hey, I just logged in, load tokens again".