Guys this is driving me nuts, losing the will to live with this.
People were trying to help me but due to the spam attack my profile and posts were cleared.
ISSUE:
I have two member role set up, "Client" and "Professional"
When a member logs in Iwant them to be redirected to a different member dash/profile page depending on their role.
I'm using the standard login menu/button and tried the following code in both the page and site panel.
PLEASE NOTE: I'm totally new to coding, second week in, so complete novice.
Code I am using is as follows:
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixData from 'wix-data';
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");}
});
Please post the editor URL of your site. Only authorized Wix personnel can get access to your site in the editor. Please include the name of the page involved.
Anyone else have any ideas on this??
@givemeawhisky I know you tried helping me with this the other day but due to the spam attack I had all my profile wiped. Just reaching out coz genuinely struggling on this one and can't get the code right