3 ms·
Looking at the code, it looks like they are not logging into MongoDB/Realm async, they are just checking if it is done, then reloading the page if not. con
by bennyp101 4y ago
Looking at the code, it looks like they are not logging into MongoDB/Realm async, they are just checking if it is done, then reloading the page if not.
const user = app.logIn(credentials);
export const client = num_users===0 ?
// wait for 1 second before reloading the page
setTimeout(() => {
window.location.reload();
}, 350) : app.currentUser.mongoClient("mongodb-atlas")
(which coincides with loads of realm users in localstorage if it continues to reload)
This https://www.mongodb.com/docs/realm/web/authenticate/ https://www.mongodb.com/docs/realm/web/authenticate/ shows how to login whilst waiting for a user to be created.
Edit: @aditiyadav Hope that doesn't come across wrong, just pointing out where the problem could be :)
- aditiyadav 4y ago@bennyp101 Thanks a lot for your feedback! I am grateful for you spending time on my website and pointing out the problem along with the possible solution :) Really appreciate it. Fixing on it now.
- aditiyadav 4y agoThis really helped me @bennyp101, Hopefully the issue is resolved now.