Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-699

Realm 10 Beta 9: callResetPasswordFunction() & resetPassword() functions missing promisify callbacks.

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • JS-10.0.0-beta.10
    • Affects Version/s: None
    • Component/s: None

      <!---

      Questions: If you have questions about HOW TO use Realm, please ask on
      StackOverflow: http://stackoverflow.com/questions/ask?tags=realm
      We monitor the realm tag.

      Feature Request: Just fill in the first two sections below.

      Bugs: To help you as fast as possible with an issue please describe your issue
      and the steps you have taken to reproduce it in as much detail as possible.

      -->

      Goals

      I'm trying to execute a password reset using a custom password reset function in Realm.

      Expected Results

      I expected to have the password reset function called using the callResetPasswordFunction().

      Actual Results

      When executing callResetPasswordFunction(), the documentation dictates it be called with two arguments and TypeScript dictates that the function be called with three arguments. I've tried it both ways:

      callResetPasswordFunction(email, password, [])
      callResetPasswordFunction(email, password)

      The resulting stack trace is:

      Error: Invalid arguments: 4 expected, but 3 supplied.
          at /home/runner/PreciousPunyTechnicians/node_modules/realm/lib/em
      ail-password-auth-methods.js:44:37
          at /home/runner/PreciousPunyTechnicians/node_modules/realm/lib/ut
      ils.js:33:13
          at new Promise (<anonymous>)
          at promisify (/home/runner/PreciousPunyTechnicians/node_modules/r
      ealm/lib/utils.js:32:16)
          at EmailPasswordAuth.callResetPasswordFunction (/home/runner/Prec
      iousPunyTechnicians/node_modules/realm/lib/email-password-auth-method
      s.js:44:16)
          at /home/runner/PreciousPunyTechnicians/index.js:17:40
          at Script.runInContext (vm.js:131:20)
          at Object.<anonymous> (/run_dir/interp.js:156:20)
          at Module._compile (internal/modules/cjs/loader.js:1133:30)
          at Object.Module._extensions..js (internal/modules/cjs/loader.js:
      1153:10)
      

      Even if I go in and add the callbacks, more errors arise.

      Steps to Reproduce

      1. Import Realm.
      2. Create a Realm App.
      3. Call callResetPasswordFunction().

      Code Sample

      https://repl.it/@timesync/PreciousPunyTechnicians

      Version of Realm and Tooling

      • Realm JS SDK Version: 10.0.0-beta.9
      • Node or React Native: Node

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: