Custom Member Profile Login Button Not Working

I want to create separate profiles for my clients. I watched the video " How to create a custom Member Profile Private Log In Page using Wix Code" and copied the code from the article. When I tried it the login button doesn’t do anything onclick. I’ve gone over this multiple times to make sure I didn’t miss anything. Any suggestions would be greatly appreciated, very frustrated.

Did you check your case in the code?
Example: export function button1_onClick() {

Yes all case is the same.

Hi,

Here 's a great video by Nayeli that covers it.

Have a look and if it still doesn’t help, please share more info:

  1. Is your button on header/footer/shown on all pages?
  2. Button code.
    3, Button properties panel.

Liran.

This is the same video that I watched while I did it.
Button number 6 takes me to the “client login” page. Button number 7 is the Login Button that I am having problems with. I’ve attached a few screenshots to make this clearer. Iv’e also includes a screenshot of the properties panel for this button. The code for the login button that I have is as follows;
export function button7_onClick() {
// user is logged in
if(wixUsers.currentUser.loggedIn) {
// log the user out
wixUsers.logout()
.then( () => {
// update buttons accordingly
$w(“#button7”).label = “Login”;
$w(“#button8”).hide();
} );
}

Thanks,
Vanessa

Hi,

You’re missing a lot of code there…
You check if the user is logged in here:

if(wixUsers.currentUser.loggedIn) {

And is so, you’re making the logout logic. So far so go.

You do nothing if the user is not logged in.

Please have a look at the code here, and try to figure out the messing pieces.

Liran.

I am having the same problem. However, I figured when you refresh the page you will see that you are actually logged in and the buttons show the correct state they should be in. (i.e Login switches to Logout and Profile button goes from hidden to display mode.
I talked to many wix support people and no one has been able to help.
I followed the same exact code on this article but no luck

Anyone experiencing the same or have been able to resolve?