Custom Registration Help

Hi
I have the code below for my custom registration form and I have the fields First name and Last name marked as required but if I only enter email and password, it registers it. Cant figure out where I’m going wrong.

import wixUsers from ‘wix-users’;
import wixWindow from ‘wix-window’;
import wixLocation from ‘wix-location’;

$w.onReady( function () {

$w("#register").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”: first,
“lastName”: last
}
} )
.then( (result) => {
console.log(“User is registered”);
wixLocation.to(“/member”);
} );
} );

});