Hi Everyone,
What i am trying to accomplish is when a logged on user clicks the logs out button, they will be redirected to specific page. However, i am having no such luck.
The relevant part of the code i am currently working is below:
export function button3_onclick(event) {
// user is logged in
if(wixUsers.currentUser.loggedIn) {
// log the user out
wixUsers.logout()
.then( () => {
// update buttons accordingly
$w("#button3").label = "Login";
$w("#button4").hide();
wixLocation.to("/Home");
} );
}
Can someone please advise?
Thank You
Fixx
Hi @fixxhalo , This is a community dedicated to Wix Forum. Please ask your doubt here were you can find lot of similar problems and get quick replies from other wix code users. (BTW I didn't found any issues with the code. So it might be a silly mistake somewhere during the execution. I will try putting a console.log after the Wixlocation.to line to check if the flow is is reaching there or not.). Thanks.