Uploaded image for project: 'Realm Cocoa SDK'
  1. Realm Cocoa SDK
  2. RCOCOA-1466

Impossible to come back to normal after `expired refresh token` error

      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

      1. Change the realm app ID in Authentication.swift
      2. Run the app
      3. Press register to create the user
      4. Press sign in
      5. Now the app should be working fine, you can add objects, log out and login again
      6. Quit the app
      7. Now go to the device settings > General > Date and time and set it manually to 2 months in the future
      8. Run the app again
      9. You should get the "expired refresh token" error and thus be logged out of your account
      10. 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

            Assignee:
            jason.flax@mongodb.com Jason Flax
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: