Action Needed - Custom Sign In / Sign Up issue

I love the idea of adding a Custom Sign-Up features for editors to add to their website. Thank you Wix. I for one have made both a Custom Sign-Up and a Login lightbox for my members. The keyword here is “lightbox”. I have a custom Login script that linked to the generic wix member login/signup lightbox. I set it so that if a user didn’t have an account they would click Log In and it would take them to my custom Log In Lightbox.

But it is showing the wix default lightbox and not my actual custom lightbox. I have made the connections to the navigation bar in the member settings but it is just weird how it is taking me to the wix default log in lightbox.

I will provide video soon.

Have you saved and published your site after saving your settings?

Plus, this is something that you should be reporting to Wix Support and not here on the Wix Code Forum as it isn’t really a problem with the code itself, more to do with Wix own settings.

I say that as I have had a similar issue like yourself, where I have had custom login and signup lightboxes setup for over a month now and everything was working fine and it would always show my custom login lightbox first.

However, since last week, whenever anybody clicks on my ‘Login’ button they are for some reason, now shown Wix own login window again even though I have not changed any of my own settings and they are still setup for custom.

I got told by Wix Support that they were looking into it and would get back to me once it was all sorted, although I am still awaiting a fix for it as of yet and my own website is still showing up Wix own login window instead of mine even though I’m on custom signup settings.

Ryan (Wix Support)
January 25, 2019
Hi,
We appreciate your patience as we continue to investigate this issue, we will keep you updated once we have some more information.
Have a great day,
Ryan K | Wix Web Guru

Alex (Wix Support)
January 24, 2019
Hi,
We have forwarded the information to the relevant department and they are investigating this matter.
We will contact you once we have feedback.
Thank you for your patience and understanding.
Alex
Wix Product Specialist

Hi @givemeawhisky ,

Thanks for that helpful information. I know this is not the correct platform to put this issue here for Wix Code, but I was just trying to raise the awareness. Hopefully they will get it resolved sooner or later. I may have to just code it so that it always show my light box first. Possible put a button over top of the Wix log in button.

I hope they can get back to us soon about this issue.

Best,
Nino

Yes I hope that too as pointless having own custom ones and not being able to use them.

The stupid thing with mine is that if I click on the ‘signup’ on Wix login window, then it closes and opens up my own custom login lightbox as it should in the first place.

Try it on yours and see if clicking ‘signup’ on Wix own login window changes it to your own custom lightbox, if it does then we’ve both got exactly the same problem and need Wix to fix it urgently.

Anyways, fingers crossed it gets sorted out soon.

Yes it does that also for me. So fingers crossed to see if it gets sorted out quickly. I hope they add more to the functionality moving forward.

Hey @givemeawhisky ,

I found a little work around. Instead of having the option of existing member login to show up first, make signup show first. Look at the pic below.


That way when users click on the loginbar it will show your custom signup lightbox. Hope this helps!

Let’s hope they can have a customized login form option in the future! :slightly_smiling_face:

Now off to other errors that I may encounter through coding with Wix Code!! :+1:

I wish life was just that simple! However I have tried that and it still doesn’t work for me.

I still annoyingly get Wix own login window show up first, that is regardless of whether I choose existing member login and login lightbox or new member signup and signup lightbox.

Plus yes, I also hope that they introduce a custom login/signup option in the near future as it seems stupid that we can’t do it already without having to resort to doing it through Wix Code itself.

Anyways, thanks for the advice and wished it did work for me too, I am like yourself now and go on to the next problem in our list!

Nino,

Do you have any code on your login page for prompting login by the user (wixUsers.promptLogin) as I have found the solution to my problem of having the Wix login window appear instead of my own custom login lightbox.

If you do then let me know as I have found out that it was this ‘promptLogin’ call that was causing the issue and making Wix own windows appear instead of my own custom lightboxes.

Finally, I had another look in Wix code Forums and found this from last year, which would explain why your solution worked for yourself:

"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.”

@givemeawhisky ,
Glad you had a chance to figure the problem out. That’s what us coders do, we keep going until we find a solution to ease our stress lol

Yes I do have code on my sign in lightbox . But I do not use the wix-users promptLogin(options) (shown below):

 let options = {"mode": "login", "lang": "es"};

wixUsers.promptLogin(options)
  .then( (user) => {
    let userId = user.id;           // "r5me-6fem-45jf-djhe-484349"
    let isLoggedIn = user.loggedIn; // true
    let userRole = user.role;       // "member"
    return user.getEmail();
  } )
  .then( (email) => {
    let userEmail = email;          // "user@something.com"
  } )
  .catch( (err) => {
    let errorMsg = err;             // "The user closed the login dialog"
  } );

Also, when I was using it in November of 2018 it was working just fine with the option “Existing Member Login” selected. So I don’t know how that didn’t work this past January of 2019 :upside_down_face:

But anyways, glad you found the solution!

Sorry i worded it wrong in my reply previously, must have been too overcome with finally getting something to work!

It wasn’t the code that was on our custom login lightbox that was causing the issue, it was actually the code I had used on my members page.

This is my lightbox which works fine, although it seems I went for the long winded option compared to yourself!

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_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);
   } )
    .catch( (err) => {
     console.log(err);
     $w("#errorMessage").expand();
   } ); 
}

It was actually in my code below for my members page that was causing my other issue.

// For full API documentation, including code examples, visit http://wix.to/94BuAAs

$w.onReady(function () {
//TODO: write your page related code here...

});
import wixUsers from 'wix-users';
import wixData from 'wix-data';
import wixLocation from 'wix-location';

$w.onReady( () => {
if(wixUsers.currentUser.loggedIn) {
$w("#loginbutton").label = "Logout";
$w("#membersareaonlystrip").expand();
$w("#whitegapforfooter").hide();

}
else {
$w("#loginbutton").label = "Login";
$w("#membersareaonlystrip").collapse();
$w("#whitegapforfooter ").show();

}
} );

export function loginbutton_onclick(event) { 
// user is logged in
if(wixUsers.currentUser.loggedIn) {
// log the user out
wixUsers.logout()
.then( () => {
// update buttons accordingly
$w("#loginbutton").label = "Login";
  $w("#membersareaonlystrip").collapse();
  $w("#whitegapforfooter ").show();
  
} );
}
// user is logged out
else {
let userId;
let userEmail;

// prompt the user to log in 
wixUsers.promptLogin( {"mode": "signup"} )
.then( (user) => {
userId = user.id;
return user.getEmail();
} )
.then( (email) => {
// check if there is an item for the user in the collection
userEmail = email;
return wixData.query("Members")
.eq("_id", userId)
.find();
} )
.then( (results) => {
// if an item for the user is not found
if (results.items.length === 0) {
// create an item
const toInsert = {
"_id": userId,
"email": userEmail
};
// add the item to the collection
wixData.insert("Members", toInsert)
.catch( (err) => {
console.log(err);
} );
}
// update buttons accordingly
$w("#loginbutton").label = "Logout";
 $w("#membersareaonlystrip").expand();
$w("#whitegapforfooter").hide();

} )
.catch( (err) => {
console.log(err);
} );
}
}

export function profilebutton_onclick(event) {
wixLocation.to(`/Members/${wixUsers.currentUser.id}`); 
}

export function entermembersbutton_onclick(event) {
wixLocation.to(`/members-area`); 
}

export function myaccountbutton_onclick(event) {
wixLocation.to(`/account/my-account`); 
}

export function websiteupdatebutton_onclick(event) {
wixLocation.to(`/website-update`); 
}

It was here on the promtlogin that mine was erroring:

// prompt the user to log in 
wixUsers.promptLogin( {"mode": "signup"} )

I originally had set it up with login as the mode and only after changing it to signup did all my troubles disappear and everything worked again.

I had tried like in your lightbox code and just used promptlogin (options) with the let options as login, however it would still show Wix own login window first - although thinking about it now, I might not have tried changing the option with the let to signup, so it might have actually worked before too!

Finally, I was exactly like you, I had setup my own custom lightboxes for login and signup and had setup the member signup settings as custom with existing login and with my login lightbox being the one in the custom choice.

i set mine up during December and like yourself, I had everything setup and it was working fine. Then all of a sudden it started to show Wix login window first again.

I complained to Wix Support and they told me first off that they couldn’t do it and I should go to Wix Code Forum instead, so I had to go back to them to remind them that it was Wix own settings in the editor that were causing it.

So finally Wix Support passed the details on to another department and I was told they would look into it and let me know when it was fixed. However, the stupid thing is after a good while waiting, I finally got another reply back and again they were saying that they couldn’t fix it as it was to do with my code and not the settings in the editor.

So after stepping back and calming down and drinking enough coffee to mellow me out, I finally resorted to fixing it myself. This is where I found others like yourself who had similar issues and about changing the settings to new member signup instead of leaving it on existing member.

However, it is pretty stupid and very obvious that Wix must have changed something somewhere to do with this area, as like yourself if seems weird that it was all working fine at the end of 2018 and then in Jan 2019 it suddenly starts being faulty.

To be honest I would not have minded if they had told us somewhere on new features or updates etc, that there had been a change to the way we had to code for custom login/signup options, or like with the member settings needing to be put on new member signup and not existing member anymore.

It just needed a bit of communication from Wix about it rather than just do it and not let anybody know and not expect users to moan, or if it was just an issue with the settings in the editor, at least to fix the issue within the editor itself and not leave us to find a workaround for it all the time.

Anyways, enough of my moaning now, I am going on too much!!

Onto our next problem solving mission…