I have used Email/Password Authentication Providers and once the user logs in for the first time a form appears for the user to enter custom data, all that worked fine but Stitch does not dynamically update the user’s custom data and only fetches a new copy of the data whenever the user refreshes their access token. This makes it really inconvenient to display the custom data after the user enters it, the data is accessible only after 30 mins if the user is logged in, I am using React.js for the UI so is there a way around this? to make the data appear in the UI right after the user enters the data for at least 30 minutes?!
Interested in the same since I also use React, btw are you using CRA, Gatsby or Nextjs what worked best for you?
Hi Folks – The current best practice is to refresh the token periodically or if you make a frontend change where you believe custom user data will be effected. Automatically updating the token when user data is changed is a good improvement and I’ve added it to feedback.mongodb.com.
A note on this
If you preface all calls to
Realm.open(...) with calls to
Realm.User.refreshCustomData() you should be able to avoid this issue.
(I’ve not fully tested this - but I assume this is what this function is for)
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.