This is my first post so please bear with me if I seem rubbish at this I am fairly new.
I have a custom login page where members are redirected after logging in that goes to a basic custom profile page I have created and that works great. However, I have certain members who have a " premium member " role, and " premium members" on my site have a separate custom profile page that I have created. My question is, is there a way for my custom login code to redirect premium members to the premium member profile page instead of the basic profile page if they have that respective role? I have played around with the getRoles code to try to get that to work but I think I am just struggling somewhere. I will post my custom login code with directions to the basic profile page that is currently working. If someone could assist me in how to complete this or point me in a better direction I would be forever grateful.
I wonder if possibly this is not the place to change the code and maybe it’s some sort of redirect if they are a premium member once they are on the basic profile page that no premium members use.
Sorry in advance for being below average at this and thank you for your time to anyone able to assist.
import wixUsers from ‘wix-users’ ;
import wixLocation from ‘wix-location’ ;
$w . onReady ( function (){
$w ( ‘#loginSubmitButton’ ). onClick ( function (){
let email = $w ( ‘#loginEmailInput’ ). value ;
let password = $w ( ‘#loginPasswordInput’ ). value ;
wixUsers . login ( email,password )
. then (()=>{
wixLocation . to ( ‘/account/profile’ )
})
})
})