Anyone had any luck with using the forgot password prompt? I tried a few different combinations but no luck yet. Is it possible to use this with a button on a page? The page I am working on is members only under a paid plan.
wixUsers.promptForgotPassword() calls the password reset screen
Can we use wixUsers.promptForgotPassword() when we are using custom registration and login pages?
Yes
I am referencing it in code on a button on click event and it is doing nothing.
Did you require wixUsers from âwix-usersâ
are you asking if my code has this?
import wixUsers from âwix-usersâ;
Yes. Also double check the button connection to the event.
Yeah to both. Still no
Ethan, I am having the same issue as Dan. I am working on a website that has a custom registration login area as lightbox. The forget password function is not working.
[code|
import wixUsers from âwix-usersâ;
import wixData from âwix-dataâ;
import wixLocation from âwix-locationâ;
import wixWindow from âwix-windowâ;
import { session } from âwix-storageâ;
var userId, userEmail;
$w.onReady( function () {
//TODO: write your page related code hereâŚ
});
export function button2_click(event, $w) {
login();
}
export function password_keyPress(event, $w) {
if (event.key === âEnterâ) login();
}
export async function login() {
$w(â#textFailâ).hide();
let email = $w(â#emailâ).value;
let password = $w(â#passwordâ).value;
wixUsers.login(email, password)
.then(() => {
console.log("User is logged in");
wixWindow.lightbox.close( **true** );
let siteEventPageUrl = session.getItem(âsiteEventPageUrlâ);
console.log(siteEventPageUrl);
if (siteEventPageUrl) wixLocation.to(siteEventPageUrl);
else wixLocation.to(â/events-wixâ);
})
. catch ((err) => {
console.log(err);
$w(â#textFailâ).show();
});
}
export function textForgotPassword_click(event) {
//wixWindow.lightbox.close();
wixUsers.promptForgotPassword();
}
export function button14_click(event) {
//wixWindow.lightbox.close();
wixUsers.promptForgotPassword();
}
export function close_click(event) {
wixWindow.lightbox.close( false );
}
[/code]
Do know what is wrong with the code? Thank you in advance!
hello
i also have a custom login and noticed that the âwixUsers.promptForgotPassword()â will lead to a blank page if you have the member area disabled, but if it is enabled ( although not being used) it will link to wix tradicional reset password page. It works for me. Hope I can help you guys in some way.
My code on my login Lightbox is:
import wixUsers from âwix-usersâ;
import wixLocation from âwix-locationâ;
$w.onReady( function (){
$w(â#loginâ).onClick( function (){
let email = $w(â#loginEmailâ).value;
let password = $w(â#loginPasswordâ).value;
wixUsers.login(email,password)
.then(()=>{wixLocation.to ( â/MemberProfile/â + email )})
})
})
export function passRecovery_click(event) {
wixUsers.promptForgotPassword()
}
I do not know how to use this, how?