We are working on a site with three different user types, and because of that we can’t use the Wix Member Area because that only supports one user type. We’ve tried to code this using Corvid, but our attempts haven’t worked thus far. Does anyone know how we would go about making three kinds of users and taking them through the signup/login process? These types all have different sign up/log in/registration pages, which are fully built, we just need to know how to connect them and the data that goes through them. We have the data from the sign-up connected to the database, that’s not an issue.
We tried using these, but they didn’t work:
This is the default Wix code:
import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;
$w.onReady( function () {
$w(‘#logIn’).onClick( function (){
let email = $w(‘#email’).value;
let password = $w(‘#password’).value;
wixUsers.login(email,password)
.then(()=>{
wixLocation.to(‘/EmployerRegistration’);
})
})
});
And this is another one we tried:
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(“/Student-Profile/”); //Change the URL ending to whatever page you want to send the user to after they log in.
} )
. catch ( (err) => {
console.log(err);
} );
}
Any help would be appreciated, ASAP!! Thank you.