News for hackers. Stuff that matters.
Re: by bennyp101 on Tuesday January 31, 2023 @09:42AM (#34595538)
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/ 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 :)

Re: by aditiyadav on Tuesday January 31, 2023 @01:55PM (#34599927)
@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.
Re: by aditiyadav on Wednesday February 01, 2023 @01:26AM (#34607179)
This really helped me @bennyp101, Hopefully the issue is resolved now.