I have no idea why but the page is not taking the user to 'my-account' and is not generating a new user for login. I have no idea what to do can someone help me?
import wixUsers from 'wix-users';
import wixWindow from 'wix-window';
import wixLocation from 'wix-location';
$w.onReady(function () {
$w('#signupButton').onClick(function() {
let userUniversity = $w('#dropdown1').value;
let email =$w('#emailAddress').value;
let password = $w('#passwordInput1').value;
let firstName = $w('#firstAndLastInput').value;
let lastName = $w('#LastName').value;
wixUsers.register(email, password, {
contactInfo: {
"firstName": firstName,
"lastName": lastName,
"userUniversity" : userUniversity
}
})
.then((result)=> {
let resultStatus = result.status;
})
.then(()=> {
wixLocation.to('/my-account');
})
})
});
//Add your code for this event here:
like userUniversity is the field of the new user created with a set value of his university which is "towson university" that was from a user input
Hi its working now. I have like another question since I created a user with first name, last name, password, and email. I added a custom field called university that is just a string. Im trying to insert collections like say 'title', 'id' with the value of the university would I do that with wixUser.currentUser.university the field was called university