Guys, I never got notifications on this and for some crazy reason I have no posts showing in my profile anymore?? Saw a load of spam the other day and just gave up.
Anyway - Still struggling on this and can’t understand why.
I’m using the standard wix member login button.
I’ve tried putting the code in both th epage and site panel, neither are working.
I’m putting the following code in to ‘Site’ panel:
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixData from 'wix-data';
$w.onReady(function () {
wixUsers.onLogin( (user) => {
let userId = user.id;
let isLoggedIn = user.loggedIn;
let userRole = user.role;
if(userRole === "Client") {wixLocation.to("/client-dash");}
if(userRole === "Professional") {wixLocation.to("/candidate-dash");}
});
});