I’m using this code to log the user out and then redirect but it seems to be doing either redirecting user or logging out to (403)
export function logoutButton_onClick() {
// user is logged in
if(wixUsers.currentUser.loggedIn) {
// log the user out
wixUsers.logout()
.then( () => {
// redirect to homepage
wixLocation.to("https://www.wix.com");
} );
}
}