@bwprado And here’s the member system coded:
(Many words have a space in between in order for wix forum to allow me to publish it).
import wixUsers from ‘wix-users’ ;
import wixData from ‘wix-data’ ;
import wixLocation from ‘wix-location’ ;
$w . onReady ( () => {
if ( wixUsers . currentUser . loggedIn ) {
$w ( “#loginButton” ). label = “Logout” ;
$w ( “#profileButton” ). show ();
} else {
$w ( “#loginButton” ). label = “Login” ;
$w ( “#profileButton” ). hide ();
}
} );
export function loginButton_click ( event ) {
// user is logged in
if ( wixUsers . currentUser . loggedIn ) {
// log the user out
Promise . all ( [ wixLocation . to ( ‘/#page1’ ), wixUsers . logout () ] )
. then ( () => {
// update buttons accordingly
$w ( “#loginButton” ). label = “Login” ;
$w ( “#profileButton” ). hide ();
} );
}