Call confirmUser in Realm function

Hi,

I am trying to implement email/pwd authentication and would like to call the confirmUser sdk method from within an existing Realm function. I don’t want to call confirmUser from the web, a React app, etc. How to I get access to the function?

Thank You

Anyone from Mongo want to chime in? Someone had asked a similar question several months ago and never got a reply.

@Herb_Ramos : Have you considered exploring our admin api’s for this purpose?

1 Like

I have not. I will give it a try and report back.

Wow. I had no idea Realm Apis existed. Mongo needs to do a better job at documentation. Even Google searches don’t mention the Realm Api’s. Thanks Mohit!

1 Like

Why not use a confirmation function instead? You certainly can call the admin API instead, but if you’re just trying to confirm users based on some backend information, that’s what confirmation functions are instead. You can select it in the options for email/password authentication.

Hi Nathan. I guess I could, but I don’t want the client to confirm. I want to complete the user confirmation in a Mongo function. I’m not sure if I am clear without giving more details on my use case.

Did you have any luck on solving this problem?

I have the same problem: I didn’t really understood where the confirmUser function should be executed from.
My best guess was to create a https endpoint with a function, and passing that endpoint address to my Email URL. However when i try to add realm as a dependency to the endpoint, i get the following error:

How can I call app.emailPasswordAuth.confirmUser in Atlas Functions?