I have my custom lightboxes all set up, all working perfectly. However - when logging out from a members page, the user is redirected to the homepage (all good), BUT my ‘Sign Up’ lightbox pops up and the user has to click the ‘x’ to then see the homepage.
How on earth do I hide it and stop this? I’ve tried everything I can think of - I don’t need to redirect as it’s already doing that, I just need the lightbox to go away!
import { authentication } from 'wix-members-frontend';
import wixLocationFrontend from 'wix-location-frontend';
$w.onReady(function () {
const isLoggedIn = authentication.loggedIn();
if (isLoggedIn) {
// WHEN USER IS LOGGED IN
$w('#login').hide();
$w('#signup').hide();
$w('#logout').show();
} else {
// WHEN USER IS NOT LOGGED IN
$w('#logout').hide();
$w('#login').show();
$w('#signup').show();
}
$w('#logout').onClick(() => {
//WHEN LOGOUT BUTTON IS CLICKED
authentication.logout();
});
authentication.onLogout(() => {
//WHEN USER IS LOGGED OUT SUCCESSFULLY
wixLocationFrontend.to("/home");
});
});
All I need is a way to get the ‘sign up’ lightbox ignored when someone logs out - I’ve tried all sorts.
Thank you for replying. It’s set to ‘no’ on both - I’ve now deleted them and am starting again, very carefully, to make sure I’m not doing something random. I was on chat with customer care earlier and they told me to delete the form. It was worth a try!
You may need to put the wixLocationFrontend surrounded in {} like the like right above it:
import wixLocationFrontend from ‘wix-location-frontend’;
import { wixLocationFrontend } from ‘wix-location-frontend’;