I can't login an user in my app but I see the users in the App services UI

Hi everyone!

I’m using this function to login into my device sync app in a simple react native app

    "react": "18.1.0",
    "react-native": "0.70.6",
    "realm": "^11.3.1"
import Realm from 'realm';
import EquipmentSchema from './schemas/Equipment';

// Place Your RealmApp ID Here
const app = new Realm.App({id: 'app-pepe-abuci'});

const credentials = Realm.Credentials.anonymous(); // LoggingIn as Anonymous User.

const getRealm = async () => {
  // loggedIn as anonymous user
  try {
    const user = await app.logIn(credentials);
    console.log(app.currentUser);

    // MongoDB RealmConfiguration
    const configuration: Realm.ConfigurationWithSync = {
      schema: [EquipmentSchema], // add multiple schemas, comma seperated.
      sync: {
        user, // loggedIn User
        flexible: true,
      },
    };
    return Realm.open(configuration);
  } catch (err) {
    console.error('Failed to log in', err);
  }
};

export default getRealm;

but the app.currentUser log returns an empty object and when I go to my App users I see all the logins confirmed

Also, I receive this error code in my terminal

 LOG  {} <- (current user log)
 LOG  {"errorCode": 1, "message": "SSL server certificate rejected"}
2 Likes

Hi Ezequiel.

Did you ever figure this out?

I’m running into a similar issue. I do have an anonymous user logged in, but when I go to open the realm, I’m getting the same error.

–Kurt

Hi Kurt,

there was a configuration in my project that gave me this error. Please check your database access in Atlas. I deleted all the users and it starts working.

Let me know if I can help you further