Skip to main content
Version: Next

PasswordResetContainer

Handles resetting the user's password after clicking on the password reset link sent to them. the reset link can be requested by the user using the PasswordForgotContainer.

Usage#

import React from "react";
import {
PasswordResetContainer,
PasswordResetPassword,
PasswordResetEmail,
PasswordResetConfirmPassword,
PasswordResetButton,
Alert,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const CustomPasswordResetView = () => {
return (
<PasswordResetContainer
onSuccess={(userObject) => {
console.log(userObject);
}}
onFailure={(err) => {
console.error(err.message);
}}
>
<Alert />
<PasswordResetEmail label="E-mail" />
<PasswordResetPassword label="New password" />
<PasswordResetConfirmPassword label="Confirm new password" />
<PasswordResetButton />
</PasswordResetContainer>
);
};

Reference#

PasswordResetContainer#

Props#

onSuccess#

(userObject) โ‡’ void

Callback function called when the password is reset succesfully.

onFailure#

(errorObject) โ‡’ void

Callback function called when the password reset fails.

Children components#

Alert#

Displays the relevant errors or success messages.


PasswordResetEmail#

Instance of Input

Read-only input field component to show user's e-mail address.


PasswordResetPassword Required#

Instance of Input

Input field component for the new password.


PasswordResetConfirmPassword Required#

Instance of Input

Input field component to confirm the new password.


PasswordResetButton Required#

Instance of Button

A button component that submits the form.

Props#

name#

string?

The title displayed inside the button