I’ve got a custom LogIn lightbox made (which works fine). What I need help with is how to use the email that’s logging in to redirect the member to a unique page I’ve created based on their email.
It’s the “wixLocation.to(‘/home’); })” that I need to change. Just don’t know how to have that change based on login email.
Example: John Doe uses his email to login and that sends him to mywebsite.com/john.doe Jane Doe uses her email to login and that sends her to mywebsite.com/jane.doe Those URLs would be pages I created for each member so as to show specific data for each of them.
(Note - I’m knew to this and not great at coding. Thank you in advance for the replies)
import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;
$w.onReady( function (){
$w(‘#loginNow’).onClick( function (){ let email = $w(‘#loginEmail’).value; let password = $w(‘#loginPassword’).value;
wixUsers.login(email,password)
.then(()=>{
wixLocation.to(‘/home’);
})
})
})
I would love to do that. My only issue is that I cannot make their members profile page autopopulate data that is not owned by them. As in, I’m inputting data and need to show each member a different/specific part of it. And I can’t figure out how to do that on their member profile page. So I wanted to link to a static page that I can link/customize their data to.
You just really need to make sure that whatever you are adding is connected to the same email value as the user that it applies to, so that when you or the user searches by email address, then whatever is stored in a dataset that is connected to that users email will only be shown.