Button Won't Redirect To Page

Hi, so this might be very elementary of me but, every time I preview and try all the components of my login procedure (logging in to the site, making your account, making posts, editing profile, etc.), the button that says “Save & Post” works sometimes but sometimes I get an error message relating to one specific member. Is this because the button is linked to the dynamic page for the members profiles or is it happening because I am previewing the site so many times it expects the same user to be on the site? Is there anything to do to fix this with code?

Firstly, if you are ever using Wix Users in your code, then only test it on a live published site.
https://www.wix.com/corvid/reference/wix-users.html
Note

  • The APIs in wix-users are only partially functional when previewing your site. View a published version of your site to see their complete functionality.

  • The APIs in wix-users can only be used once the page has loaded. Therefore, you must use them in code that is contained in or is called from the onReady() event handler or any element event handler.

If you are redirecting the user to their profile page, then that link will only work for that specific site member.

If another site member tries to view their profile page, then they will get the error like you have above as you don’t have the correct permissions.

If you use the Wix Members app then it is only the specific site member that can see their own member pages.

If you use the Wix Member Profile tutorial then again, it will be only the specific site member that can see their page.
https://support.wix.com/en/article/corvid-tutorial-building-your-own-members-area

However, you can easily move the site member onto their own profile page after logging in simply by using the link in the tutorial above.

export function profileButton_click(event) {
wixLocation.to(`/Members/${wixUsers.currentUser.id}`);
}

Ok, so besides the code, I also have to change the permissions I’m assuming to custom