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

Object used for `logIn` different that than `registerUser`

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None

      Currently there are two different objects being used for registering and login. There should be a shim around login which would allow for a simple object to be used for auth instead of a specific Realm.Credentials object. That way this code:

      // Register
      try{
      app.emailPasswordAuth.registerUser({email, password});
      }
      
      // Login
      const creds = Realm.Credentials.emailPassword(email, password);
      await app.logIn(creds);
      

      could be simplified to:

      const creds = {email, password}
      app.emailPasswordAuth.registerUser(creds);
      await app.logIn(creds);
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            andrew.meyer@mongodb.com Andrew Meyer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: