I want to use a custom password reset function to be invoked by my Swift client via sendResetPasswordEmail.
In the MongoDB Realm Authentication Providers page I selected Automatically confirm users for User Confirmation Method and Run a pssword reset function for Password reset method.
After selecting + New Function in order to provide a body for the resetFunction and entering the code below:
Can you also screenshot your current config and the stack trace when that error appears? Unfortunately, I don’t get too much information about the error from just looking at your app.
I’m not sure what you mean by current config, and there is no stack trace, just an error on the Authentication Providers page: “Invalid value for resetFunction”.
Below is the link where you can find Authentication Providers page screen shots:
It seems like you’re hitting “new function” but you already have “resetFunction” defined. For now, you can get around this be hitting “existing function” and using the resetFunction or a new function you have defined.
We will work on making that error message a bit more clearer for users - hope this helps!
It is not clear to me yet how I can edit the body of the resetFunction, or any other function that I create to reset the user’s password and save these changes, without getting the error I mentioned earlier.