Hello, I have the following use case: An admin user (without restrictions) goes off the grid and meets another person. The admin must create a new user for that person and also possibly create a few documents that include the new user id. Btw, I am only using the Email/password auth provider.
My attempt: From my testing registering new users through the Realm SDK - app.emailPasswordAuth.registerUser({email, password})
requires a connection to the internet (makes sense). Let me know if I am wrong. I’ve read this topic.
Different approach: I’ve set up my entire database so that any dependency on the user id is linked to the object id of the document inside my custom user data collection(collection name is users
). My plan is while being offline, the admin will create a new document inside the synced users
collection. Later when he comes back online the new document will sync, then it will trigger a function and inside the function, I create and confirm the actual app user.
Question 1: Is there a way to do this using the function context
or is using the admin API the only way?
Question 2: Any recommendations for the use case or possible pitfalls that I am not noticing?