Skip to content

Commit

Permalink
#132 - Changeable URL for "Forgotten Password" on Login pattern (#136)
Browse files Browse the repository at this point in the history
Co-authored-by: imikulec <[email protected]>
  • Loading branch information
ivam5 and imikulec authored Oct 27, 2023
1 parent ac21f0c commit 79807b2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libs/patterns/src/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ type LoginProps = {
*/
forgotPassword?: boolean;

/**
* Specifies the URL or navigation link to redirect the user when
* they click on a "Forgot Password" link.
*/
forgotPasswordLink?: string;

/**
* Function that handles values inputted into the component on submit.
*/
Expand Down Expand Up @@ -115,6 +121,7 @@ export default function Login({
rememberMe,
buttonText,
forgotPassword,
forgotPasswordLink,
initialValues,
handleSubmit,
children,
Expand Down Expand Up @@ -179,7 +186,7 @@ export default function Login({
</Button>
{forgotPassword === true && (
<div className={tokens.link.container}>
<Link className={tokens.link.master} to="/forgotten-password">
<Link className={tokens.link.master} to={forgotPasswordLink ?? "/forgotten-password"}>
{<Intl name={"login.labels.forgotPassword"} />}
</Link>
</div>
Expand Down

0 comments on commit 79807b2

Please sign in to comment.