diff --git a/src/login/KcPage.tsx b/src/login/KcPage.tsx index 33a4c8df..e50b5307 100644 --- a/src/login/KcPage.tsx +++ b/src/login/KcPage.tsx @@ -13,6 +13,7 @@ const Login = lazy(() => import("./pages/Login")); const Register = lazy(() => import("./pages/Register")); const LoginUpdateProfile = lazy(() => import("./pages/LoginUpdateProfile")); const LoginUpdatePassword = lazy(() => import("./pages/LoginUpdatePassword")); +const LoginResetPassword = lazy(() => import("./pages/LoginResetPassword")); const LoginPageExpired = lazy(() => import("./pages/LoginPageExpired")); const LoginVerifyEmail = lazy(() => import("./pages/LoginVerifyEmail")); @@ -79,6 +80,14 @@ export default function KcPage(props: { kcContext: KcContext }) { doUseDefaultCss={false} /> ); + case "login-reset-password.ftl": + return ( + + ); case "login-page-expired.ftl": return ( ; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + render: () => +}; + +/** + * WithUsernameError: + * - Purpose: Tests when there is an error with the email/username input (e.g., user not found). + * - Scenario: Simulates the case where the user enters an invalid or non-existent email, and an error message is displayed. + * - Key Aspect: Ensures the email input field shows an error message when validation fails. + */ +export const WithUsernameError: Story = { + render: () => ( + field === "username", + getFirstError: () => "User not found." + } + }} + /> + ) +}; diff --git a/src/login/pages/LoginResetPassword.tsx b/src/login/pages/LoginResetPassword.tsx new file mode 100644 index 00000000..6f3c93b3 --- /dev/null +++ b/src/login/pages/LoginResetPassword.tsx @@ -0,0 +1,68 @@ +import { fr } from "@codegouvfr/react-dsfr"; +import Button from "@codegouvfr/react-dsfr/Button"; +import Input from "@codegouvfr/react-dsfr/Input"; +import { getKcClsx } from "keycloakify/login/lib/kcClsx"; +import type { PageProps } from "keycloakify/login/pages/PageProps"; +import type { I18n } from "../i18n"; +import type { KcContext } from "../KcContext"; + +export default function LoginResetPassword(props: PageProps, I18n>) { + const { kcContext, i18n, doUseDefaultCss, Template, classes } = props; + + const { kcClsx } = getKcClsx({ + doUseDefaultCss, + classes + }); + + const { url, messagesPerField } = kcContext; + + const { msg, msgStr } = i18n; + + return ( + + ); +}