Custom Login

Is custom log in really possible with Wix? I have done custom signup for several websites and it works well. Now my concern is the custom login and how effective it is, I saw something similar on a Wix powered website but he still provided a button for the Wix’s standard login page. Any advice?

Hi,

Custom login is possible, please read the Wix Users API https://www.wix.com/corvid/reference//wix-users.html#login

You need to capture the email and password in 2 input elements and make the call to the Wix Users API’s login() function

@Spark

As Shan says, just read the Wix Users api section and you will see how to do it through the use of your own custom login lightbox, the same with what you can do with your own register/signup lightbox too.

https://support.wix.com/en/article/about-login-signup-and-password-windows
https://support.wix.com/en/article/about-the-member-signup-form
https://support.wix.com/en/article/corvid-enabling-custom-site-registration
https://support.wix.com/en/article/corvid-tutorial-creating-a-custom-registration-form-with-code

Now that we have the login API, you can create your custom login page, and add a link from the signup custom page to the login page (eg., "already a member? click here to login).

In addition, in the member signup settings panel, under the “which option shows first” section you need to select " New member signup ".

This way the default login page will never be triggered by an external application / restricted page / login bar, and only the custom signup page will be opened with a link to the custom login page.

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

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

export function loginButton_click(event) {

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

 wixUsers.login(email, password)
   .then( () => {
     console.log("User is logged in");
     wixLocation.to("/account/my-account");  //Change the URL ending to whatever page you want to send the user to after they log in.
   } )
    .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 also have been facing the same issue from many days and that is why I have checked https://itunessupport.org/blog/cannot-install-itunes-on-windows-7/ and it really helped me to fix it. So if you have any sort of unfixed problem you can check the site.