Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run reset password function using Node SDK #4143

Closed
ivanBereznev opened this issue Dec 13, 2021 · 3 comments · Fixed by #4148
Closed

Cannot run reset password function using Node SDK #4143

ivanBereznev opened this issue Dec 13, 2021 · 3 comments · Fixed by #4148
Assignees

Comments

@ivanBereznev
Copy link

ivanBereznev commented Dec 13, 2021

How frequently does the bug occur?

All the time

Description

I use NodeJS Realm SDK.

I expect my password reset function to be called when I do the following:

await app.emailPasswordAuth.callResetPasswordFunction('[email protected]', 'myNewPassword')

or at least when I use new API as this is described here:

await app.emailPasswordAuth.callResetPasswordFunction({ email: '[email protected]', password: 'myNewPassword' })

But both approaches result in the same error.

Stacktrace & log output

Error: Error: resetDetails must be of type 'object', got ([email protected])
at /myProject/node_modules/realm/lib/email-password-auth-methods.js:76:35
at /myProject/node_modules/realm/lib/utils.js:52:7
at new Promise (<anonymous>)
	at promisify (/myProject/node_modules/realm/lib/utils.js:51:12)
	at EmailPasswordAuth.callResetPasswordFunction (/myProject/node_modules/realm/lib/email-password-auth-methods.js:76:12)
	at _callee$ (/myProject/utils/resetPassword.js:11:31)
	at tryCatch (/myProject/node_modules/regenerator-runtime/runtime.js:63:40)
	at Generator.invoke [as _invoke] (/myProject/node_modules/regenerator-runtime/runtime.js:294:22)
	at Generator.next (/myProject/node_modules/regenerator-runtime/runtime.js:119:21)
	at asyncGeneratorStep (/myProject/utils/resetPassword.js:11:103)

Can you reproduce the bug?

Yes, always

Reproduction Steps

  1. Enable email/password auth for Realm Application
  2. Configure it to run custom password reset function
  3. Register a user
  4. Try to run password reset function for registered user:
const app = new Realm.App({id: id})
await app.emailPasswordAuth.callResetPasswordFunction({ email: '[email protected]', password: 'newUserPassword' })

Version

10.10.1

What SDK flavour are you using?

MongoDB Realm (i.e. Sync, auth, functions)

Are you using encryption?

No, not using encryption

Platform OS and version(s)

Debian GNU/Linux 9.13 (stretch)

Build environment

No response

@takameyer
Copy link
Contributor

Thanks for reporting this issue. We will look into it as soon as we can. I assume this is happening in a Node environment (not React Native)?

@ivanBereznev
Copy link
Author

@takameyer yes, this happens in Node environment.

@takameyer
Copy link
Contributor

@ivanBereznev we have found the issue and it will be fixed in the next release. Here is the PR:
#4148

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants