Would Someone Please Help Me With This Login Redirect Code :)

Hello…I’m using Wix Studio wanting to redirect people who login to our site and those who sign up to their member page using the custom sign up and login forms. I’m not a coder, however, I watched several videos and added this code but I’m still being directed to the home page after I publish my site to see if it works. If someone would please help me out, I’d greatly appreciate it.

Also, when someone first signs up, as they are not a “wix user” yet, do I need to call that api and add that part of the code? Thank you so much!

import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;

$w.onReady(function (){
$w(‘#loginBtn’).onClick (()=>{
let email = $w(‘#loginEmail’).value;
let password = $w(‘#loginPassword’).value;
wixUsers.login (email,password)
.then((=>{
wixLocation.to(“/members-page”);
}))
})
})

  1. Well first of all —> WixUsers <— is an OUTDATED API !!! Do not follow old posts. Old posts are not UPTODATE ANYMORE !!!

  2. You will have to REPLACE your WixUsers-API with WixMembers-API (i would recommend to work on BACKEND instead of using FRONTEND-CODE.

  3. And i am not sure, if this little information about your setup is enough to give you a good and precise answer (depending of what you have already build, coded and setted-up in your project).

  4. There are many ways of how to setup a LOGIN or REGISTERING-SYSTEM.

Thank you so much. I tried changing the code to Wix Members and it didn’t work. Unfortunately, I’m not a coder so I have no idea how to make this work. Also, I find Wix Studio very difficult to use and wish I could go back to the old Wix editor for my needs. I’m going to have to hire a programmer where I didn’t have to before. :frowning:

You can go back to Editor-X oder ordinary Editor.
At least you can start a new project/site including this 2-options.

Thank you again. Unfortunately, the regular editor doesn’t give me all of the functionality that I need to Wix Studio it is. However, I am starting to figure out how all of the elements work together and what to select on the inspector panel to achieve the results I need. I will definitely keep your contact info as there will come a time when I’ll want some programming done, including the membership redirect. :slight_smile:

Wix-page without programming → not a real good solution :grinning: