Skip to main content
Version: Next

PasswordlessRequestModal

The password request modal is used when the user wants to request a Magic Link sent via e-mail.

Loading...

Usage#

import React from "react";
import {
PasswordlessRequestModal,
PelcroModalController,
usePelcro,
} from "@pelcro/react-pelcro-js";
import "@pelcro/react-pelcro-js/dist/pelcro.css";
export const PasswordlessRequestExample = () => {
const { switchView } = usePelcro();
return (
<>
<button onClick={() => switchView("passwordless-request")}>
Need Magic Link? click here
</button>
<PelcroModalController>
<PasswordlessRequestModal />
</PelcroModalController>
</>
);
};

Reference#

Props#

onDisplay#

() โ‡’ void

Callback function called when the modal is first displayed.

onClose#

() โ‡’ void

Callback function called when the modal is closed.

onSuccess#

(userObject) โ‡’ void

Callback function called when the password reset request is sent succesfully.

onFailure#

(errorObject) โ‡’ void

Callback function called when the password reset request fails.