Double Registration?

I’ve created a custom signup form but it appears to do the standard registration process before doing the custom code as I’m always getting the following message:
“form submit failed with: Register Attempt Failed - User Already Exists”

Yes, I’m using unique email addresses when I test. Should I set something to override the standard registration process?

Here’s the code:

import wixUsers from 'wix-users';

$w.onReady(function () {
    $w('#btnSignup').onClick( () => {
    //register member
    wixUsers.register($w('#email').value, $w('#password').value, {
    "contactInfo": {
    "firstName": $w('#firstname').value,
    "lastName": $w('#lastname').value
    }
});
});

TIA!

Your signup code on your lightbox page should be something like this.

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

$w.onReady(function () {
    
   $w("#registerButton").onClick( (event) => {
        
   let email = $w("#email").value;
   let password = $w("#password").value;
   let first = $w("#firstName").value;
   let last = $w("#lastName").value;

   wixUsers.register(email, password, {
       contactInfo: {
        "firstName": $w('#firstName').value,
        "lastName": $w('#lastName').value,
       }
      } )
      .then( (result) => {
        let resultStatus = result.status;
  wixWindow.lightbox.close();
  wixLocation.to("/sign-in-status"); //Change the URL ending to whatever page you want to send the user to after they log in.
      } );     
    } );
    
});

This works perfectly and closes after registering details before moving user onto the specified page, then both names will be saved in Contacts on your Wix Dashboard and once site member is manually approved the member details will be added to ‘members’ database which is from this tutorial here.

Also remember to do this if you choose the Corvid option for signup/login so that your member signup settings are set to the lightbox and not Wix still.
https://support.wix.com/en/article/corvid-enabling-custom-site-registration

@givemeawhisky Thank you - that was it - it was set to a custom form signup instead of a Corvid form.