Realm web sdk user registration and confirmation not working

Documentation states that when registering a user via web SDK, the user will have to be confirmed before they can sign in; either by auto confirmation of custom confirmation function.

This is broken.

When I register a user via app.emailPasswordAuth.registerUser({ email })

  1. The custom confirmation function completes returning ‘success’
  2. An email is sent to the use, from my own smtp server, containing the token generated by App Services.

The problem is that the user can immediately login, without confirming via the token in the email sent.

This did work correctly about a year ago, that was when I last tested Auth Flow.
I am using realm-web v2.0.1, but I went back to v1.7.1 which was the last version that I was using when the Auth Flow worked as expected, but still broken now.

1 Like

It’s not that intuitive, but you have to return some other value other than ‘success’.
I call my external email middleware, if it returns ‘success’ then I make the App Services function return ‘pending’.
If my email middleware returns ‘fail’, then I return ‘fail’ in App Services Function.
This way my front end will know if it’s actually a ‘fail’.

The solution is to return some other value besides ‘success’ or ‘fail’ in the App Services Function.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.