Sam
04/06/2023, 1:05 AMloadTokens
?
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".