realm / realm-object-server

Tracking of issues related to the Realm Object Server and other general issues not related to the specific SDK's
https://realm.io
293 stars 42 forks source link

Docs Android Login example needs to be fixed #418

Closed zeeshanz closed 5 years ago

zeeshanz commented 5 years ago

In the docs, at this URL https://docs.realm.io/sync/using-synced-realms/user-authentication/username-password-provider the example for the login is not correct. It should be SyncUser.logInAsync(...) instead of SyncUser.login(...)

String authURL = "https://myinstance.cloud.realm.io";
SyncCredentials credentials = SyncCredentials.usernamePassword(username, password, false);

SyncUser.login(credentials, authurl, new SyncUser.Callback<SyncUser>() {
  @Override
  public void onSuccess(SyncUser user) {
    // User is logged
  }
​
  @Override
  public void onError(ObjectServerError error) {
    // Handle error
  }
});
cmelchior commented 5 years ago

Fixed