Expired tokens don't refresh before a 401 error in @realm/react #5229
Labels
O-Community
T-Bug
Waiting-For-Reporter
Waiting for more information from the reporter before we can proceed
How frequently does the bug occur?
Always
Description
We're using @realm/react in a React Native project and occasionally get 401 errors saying the user token has expired when making GraphQL requests. Subsequent requests appear to work.
Previously, I used the refreshToken process outlined here: https://www.mongodb.com/docs/realm/web/graphql-apollo-react/#refresh-access-tokens However, I don't see the
refreshToken
method available on the @realm/reactuseUser
object. Instead it is a string.Stacktrace & log output
Can you reproduce the bug?
Always
Reproduction Steps
Bring the app to the foreground after the user token has expired and the first request throws the 401 error, despite being wrapped inside of the Realm provider with an authenticated user logged in.
Version
@realm/react@0.4.1
What services are you using?
Atlas Device Sync
Are you using encryption?
No
Platform OS and version(s)
iOS 16.1.2 (20B110)
Build environment
Which debugger for React Native: ..
Cocoapods version
RealmJS (11.2.0)
The text was updated successfully, but these errors were encountered: