Can we use Forgot Password Prompt for users to change password?

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.

1 Like

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?