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"}