logInAsync not entering onSuccess or onError, so cannot create configuration

cloud

#1

I am trying to login to my realm cloud, but because the logInAsync never enters onSuccess, my SyncUser user remains null. When I try to set config, I get a NullPointerException because user is null. I tried using LogIn synchronously, but I was receiving an error saying a string cannot be converted to a JSon object. I’m not using JSon.

        String email = mEmailView.getText().toString();
        String password = mPasswordView.getText().toString();

        String authURL = "https://unbranded-metal-bacon.us1a.cloud.realm.io";
        SyncCredentials credentials = SyncCredentials.usernamePassword(email, password, true);
        RealmAsyncTask task = SyncUser.logInAsync(credentials, authURL, new SyncUser.Callback<SyncUser>() {
            @Override
            public void onSuccess(SyncUser result) {
                user = result;
            }

            @Override
            public void onError(ObjectServerError error) {
                System.out.println("failed");
            }
        });

        String url = "realms://unbranded-metal-bacon.us1a.cloud.realm.io/~/travelin";
        config = user.createConfiguration(url).build();
    }

#2

@burns140 Your authURL needs a /auth appended to it to hit the right endpoint.


SyncUser.current() is null even after running logInAsync() with correct credentials