From 6452f5f5ab607cf730b8711c8d805fa9a724a25d Mon Sep 17 00:00:00 2001 From: Damien Le Thiec Date: Mon, 10 Nov 2025 09:31:17 +0100 Subject: [PATCH] feat: add themed LoginVerifyEmail page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add DSFR-styled LoginVerifyEmail page (login-verify-email.ftl) that displays: - Info Alert with email verification instruction - User email displayed in message - Inline form to resend verification email with DSFR link-styled button - Back to login link at the bottom - Clean DSFR styling consistent with other pages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/login/KcPage.tsx | 9 +++ src/login/pages/LoginVerifyEmail.stories.tsx | 43 +++++++++++++ src/login/pages/LoginVerifyEmail.tsx | 64 ++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 src/login/pages/LoginVerifyEmail.stories.tsx create mode 100644 src/login/pages/LoginVerifyEmail.tsx diff --git a/src/login/KcPage.tsx b/src/login/KcPage.tsx index c6b4bc54..010d4302 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 LoginVerifyEmail = lazy(() => import("./pages/LoginVerifyEmail")); const doMakeUserConfirmPassword = false; @@ -77,6 +78,14 @@ export default function KcPage(props: { kcContext: KcContext }) { doUseDefaultCss={false} /> ); + case "login-verify-email.ftl": + return ( + + ); default: return ( ; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + render: () => ( + + ) +}; + +/** + * WithCustomEmail: + * - Purpose: Tests the page with a specific email address. + * - Scenario: Simulates a user with a custom email address to verify the display. + * - Key Aspect: Ensures the email is correctly displayed in the verification message. + */ +export const WithCustomEmail: Story = { + render: () => ( + + ) +}; diff --git a/src/login/pages/LoginVerifyEmail.tsx b/src/login/pages/LoginVerifyEmail.tsx new file mode 100644 index 00000000..afe24fe8 --- /dev/null +++ b/src/login/pages/LoginVerifyEmail.tsx @@ -0,0 +1,64 @@ +import { getKcClsx } from "keycloakify/login/lib/kcClsx"; +import type { PageProps } from "keycloakify/login/pages/PageProps"; +import type { KcContext } from "../KcContext"; +import type { I18n } from "../i18n"; +import Alert from "@codegouvfr/react-dsfr/Alert"; +import { fr } from "@codegouvfr/react-dsfr"; + +export default function LoginVerifyEmail(props: PageProps, I18n>) { + const { kcContext, i18n, doUseDefaultCss, Template, classes } = props; + + const { kcClsx } = getKcClsx({ + doUseDefaultCss, + classes + }); + + const { url, user } = kcContext; + + const { msg, msgStr } = i18n; + + return ( + + ); +}