After every refresh in members only area the user is logged out for a brief moment and after 2/3 seconds logged back in. how to stop this from happening

So as the topic says, there is a delay that disrupts the data that is supposed to be shown and make it not only not work but is very frustrating.

Hi Adam!

I’m happy to look into this issue for you. Are you able to confirm if this issue is only happening to you? or does it happen with multiple members on different devices. This information will help me understand the problem better.

If you’re willing to, you may also provide test credentials that I can use to view this issue on the live page.

Thanks for trying to help!

it happens no matter the device, the members area is only available to certain accounts so i dont think you will be able to see this. but basically when refreshed instead of the account profile pic in top right corner it shows “LOG IN” and after 3/4 seconds it shows the account profile pic again that was logged in before refresh and everything seems fine but my cms connected reapter that is on that site stops showing the correct data after that.

its supposed to show a container that contains some text and links but after the refresh in the 3/4 seconds after refresh it shows nothing but after it logs in it shows the container but the text in conteiner seems to not be connected to cms which is wierd.

Hey Adam, I’m having this exact same problem and is super frustrating for me and my clients. I hope someone can respond.

Here’s my page code calling backend function to check to see if user is logged in, if not returns false and a lightbox to login pops up, if user is logged in then code proceeds.
// Checked if user is logged in
let isLoggedIn = await checkIfLoggedIn();
if (!isLoggedIn) {
console.log(“Member is not logged in”);
wixWindowFrontend.openLightbox(“lbLogIn”)
.then((resp) => {
if (resp === “ok”) {
wixWindow.scrollTo(0, 0, {“scrollAnimation”: false});
}
})
}

And here’s the backend code that is called from front end to check if logged in
import { Permissions, webMethod } from “wix-web-module”;
import { currentMember } from “wix-members-backend”;

export async function checkIfLoggedIn() {
return(await myGetCurrentMemberFunction());
}

const myGetCurrentMemberFunction = webMethod(
Permissions.Anyone,
async (options) => {
try {
const member = await currentMember.getMember(options);
const memberId = member._id;
//const fullName = ${member.contactDetails.firstName} ${member.contactDetails.lastName};

            //return member;
            return(true);
        } 
        catch(error) {
            console.error(error);
            return(false);
        }
    },
);