Login link?

I’m creating a custom sign up page and would like to link Login page to one of the buttons so user can log in if they have already had accounts. I couldn’t find the url/page/lightbox to the login in page however. Any ideas how I can link my button to the login page?

Thanks in advance.

U can use code to trigger the login lightbox to appear when they click the button. I
The code is available in the API reference.

Hi :raised_hand_with_fingers_splayed:

Just prompt them to login, add this code to the button’s onClick() event handler.

import wixUsers from 'wix-users';

$w('#button1').onClick( (event) => {
    wixUsers.promptLogin().then((user) => {
        let userId = user.id;
        console.log('User logged in!')
    }).catch((err) => {
        console.error(err);
        $w('#errorMessage').text = err;
    })
})

Learn about it here:
https://www.wix.com/corvid/new-reference/wix-users/promptlogin

Hope that helped~!
Ahmad

Thank you both for your reply, but this is not exactly what I need.
I’m customizing a sign up page, and I want to utilize the default Login for facebook and Google sign in. So I created two buttons, one for facebook and one for Google, and I’m trying to link the Login lightbox/page to these buttons. However, I can’t find the lightbox for Login anywhere.
Or is there any way that I can connect the facebook/google buttons in my sign up page to the ones in default login page directly?

Many thanks!

I can’t find the lightbox for default Login. Any suggestions?

Just to add to Ahmad comment above, if you want to open a specific option then you should use options with the prompt login function.

This way you can specifiy which version is shown to the user of either the login or the signup window.

If you just use promptLogin as it is, it will default to the option that you chose in the Member Signup settings.

let options = {"mode": "login", "lang": "es"};
wixUsers.promptLogin(options)

Hi,

In addition, you can also refer to the following article which explains how to create the entire flow in building a custom member’s area with code examples.
https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area

You can only use the social login through the Wix Default window
https://support.wix.com/en/article/about-the-member-signup-form

If you want to implement the social logins on the Custom or the Corvid window then you can do something like this…
https://www.wix.com/corvid/forum/community-discussion/solution-google-facebook-user-information-on-login

it was useful to me. Thank you, When you use this code for a button we add to the page, it enables the login page to open.

$w.onReady(function () {
  $w('#login').onClick( (event) => {
    wixUsers.promptLogin().then((user) => {
 let userId = user.id;
        console.log('User logged in!')
    }).catch((err) => {
        console.error(err);
 //$w('#errorMessage').text = err;
    })
})  //TODO: write your page related code here...

});