Member Login Bar / Login Lightbox not working

Hi there,

I have created a custom login lightbox so that when the members login bar (wix app) is clicked the lightbox appears, users input their email and password and click ‘Login’. Once ‘Login’ is clicked they should be redirected to the Home page.

The issue is that everything works up until clicking the lightbox ‘Login’ button then nothing happens! No redirect and the user does not get logged in. The member login bar does not change to show the users profile picture and name and provide the drop down menu allowing them to log out. I am using registered information that I can see exists in the members database so I should be able to login with that information.

I have copied the code I am using below - code was taken from a Code Queen Tutorial: https://www.youtube.com/watch?v=QbH8_eudjbE

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(“/home”); //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.
} );
}

Did you manage to solve this?
I currently have the same issue

The reason for your problem is that the Wix Login Bar is a feature of the Wix Members app.
https://support.wix.com/en/article/designing-your-member-login-bar-and-menu

It is a closed shop when it comes to connecting it with code, you can’t do anything with it.

Either you use the Login Bar to let your users login in through it as it should be used with the Wix Members app.

Or, to use code, you DON’T add the Login Bar to your site and you use the code for custom signup and login lightboxes with buttons for login and signup etc.

Plus, if you use custom lightboxes, then you DO NEED to adjust your member signup settings to make sure that Wix knows you are using them.
https://support.wix.com/en/article/corvid-enabling-custom-site-registration

Martyn, that was not for you, that was for the original poster, unless of course you have tried to use the Wix Login Bar with code too.

Hi,

I’ve had a custom lightbox login page that has been working for the last 6 months or so simply using two input boxes (email & password) and then passing them to wixusers.login function (the code is copied straight from the corvid help pages!)

In the last few days though it’s stopped working and simply returns an " unknown failure (500)" to the console

As far as i’m aware nothing has changed, so does anyone know why or how to fix it?

Cheers

Lee.

You are better off posting a new forum post instead of leaping onto another one.

As for your issue, check previous posts about it as it is an ongoing issue for certain people who are unlucky enough to get caught up in the affected servers.

See the older posts from earlier.
https://www.wix.com/corvid/forum/community-discussion/wix-users-and-more-is-down
https://www.wix.com/corvid/forum/community-discussion/help-login-and-signup-just-stopped-working