That’s totally fine. All of us were alien to code at some point! (:
Here’s the correct code. Simply delete any previous code inside your masterPage.js file and paste this:
import wixLocationFrontend from 'wix-location-frontend';
import { authentication } from 'wix-members-frontend';
authentication.onLogin(async (member) => {
wixLocationFrontend.to('https://www.sybaritesporting.com/');
});
Just to let you know what the users above suggested:
- wix-users is an old API and is now depricated and replaced by the new wix-members-frontend, which we have used here.
- import statements should always be at the beginning of your code, as you’d want to first import all the relevant libraries / APIs that are necessary for the code to run before actually calling them through the code. Else it will result in an error like the one you faced previously.
Looking at the error logs you’ve provided, it does seem that your homepage code might have some errors in it too, so make sure to check and rectify those out.
Cheers!