Custom Login

I made my custom login but the login button doesn’t work and I made sure it’s valid in the Code panel. Any ideas on how I can make my login but work?

Hello Haiden, i try to see your project…wait a minute…


Sorry could not see anything :grin:

  1. Code?
  2. Pics?
  3. Structure?
  4. Console-errors?

Where are all the INPUTS?

Pictures coming right now.

https://lh3.googleusercontent.com/-mBN3m3vCzns/XwjGm5SqSTI/AAAAAAAALCA/PlL8UinEgJEIYfYDIzKteIV6NTJ18faRACK8BGAsYHg/s0/2020-07-10.png

https://lh3.googleusercontent.com/-6hLyHeTkqQU/XwjHLNzI35I/AAAAAAAALCM/FfrJXFybk_gBqQmJd6AHK8PIL8-UdbxigCK8BGAsYHg/s0/2020-07-10.png

Could you please iput your code here in TEXT-form?
Use the Code-Tags please.

Ok!

import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';

$w.onReady(function () {
$w('#fogortPassword').onClick( (event) => {
 //wixWindow.lightbox.close()
   wixUsers.promptForgotPassword()
   .then( ( ) => {
 //
   } )
    .catch( (err) => {
 let errorMsg = err;  //"The user closed the forgot password dialog"
    });
 });
});

export function loginButton_onclick(event) {

 let email = $w("#Email").value;
 let password = $w("#Password").value;

 wixUsers.login(email, password)
   .then( () => {
     console.log("User is logged in");
     wixWindow.lightbox.close();
     wixLocation.to(wixLocation.url);  //This reloads the same page and allows code to show hidden member parts.
   } )
    .catch( (err) => {
     console.log(err);
     $w("#errorMessage").expand();  // You can delete this line if you are not going to add an error message. Use a regular text element set to 'collapse on load' from the Properties Panel.
   } ); 
}


 

I made my custom login but the login button doesn’t work and I made sure it’s valid in the Code panel.
What exactly do not work with your custom log-in?

Can you describe a little bit more detailed? Do you get any ERROR-MESSAGES in console?

Maybe, it could be my button?

Check the connection between CODE and PAGE…
You have an external "onClick"Event-handler, i assume you did not connect it with your code…
see here…


Take also a look here… L ogIn & more… here… S imple-Registration (example) and here… A utomatic-Registration (example) It could help you understanding better the logIn-process.

Ok, I will take a look right now.

I’ve had right the whole time…

:wink: It was the BUTTON, right?
Seems that you liked my example :sunglasses: