`I am trying to make a custom login to a dynamic members page with some code from several youtube clips, but it doesn´t work. If I try to login via a profile in my database, it returns 404. I´m not an expert on coding so I would be grateful if someone can edit my code. /Thanks
`
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';
export function loginButton_click(event) {
let email = $w("#email").value;
let password = $w("#password").value;
wixUsers.login(email, password)
.then( () => {
console.log("User is logged in");
wixLocation .to(`/members/${wixUsers.currentUser .id}`);
} )
.catch( (err) => {
console.log(err);
$w("#errorMessage").expand();
} );
}
`