-
Type: Bug
-
Resolution: Fixed
-
Priority: Trivial - P5
-
None
-
Affects Version/s: None
-
Component/s: None
How frequently does the bug occur?
All the time
Description
After 30 days of being logged in, users get a expired refresh token error, that I catch in syncManager.errorHandler. This seems to be the normal behavior. My problem is, I can't get back to a normal state after getting this error. If I logout/login the user, I get the same error.
I'm using email/password auth, I don't know if this happens with other authentication providers.
What to do after this error?
Stacktrace & log output
Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
expired refresh token
Can you reproduce the bug?
Yes, always
Reproduction Steps
Repo: https://github.com/jeanbaptistebeau/realm_expiredrefreshtoken
- Change the realm app ID in Authentication.swift
- Run the app
- Press register to create the user
- Press sign in
- Now the app should be working fine, you can add objects, log out and login again
- Quit the app
- Now go to the device settings > General > Date and time and set it manually to 2 months in the future
- Run the app again
- You should get the "expired refresh token" error and thus be logged out of your account
- Try pressing sign in: from now on, you should get the same error everytime you log in
Version
10.15.1
What SDK flavour are you using?
MongoDB Realm (i.e. Sync, auth, functions)
Are you using encryption?
No, not using encryption
Platform OS and version(s)
iOS 14
Build environment
Xcode version: 12.5.1
Dependency manager and version: Cocoapods