diff --git a/src/login/KcPage.tsx b/src/login/KcPage.tsx index 010d4302..33a4c8df 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 LoginPageExpired = lazy(() => import("./pages/LoginPageExpired")); const LoginVerifyEmail = lazy(() => import("./pages/LoginVerifyEmail")); const doMakeUserConfirmPassword = false; @@ -78,6 +79,14 @@ export default function KcPage(props: { kcContext: KcContext }) { doUseDefaultCss={false} /> ); + case "login-page-expired.ftl": + return ( + + ); case "login-verify-email.ftl": return ( ; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + render: () => +}; + +/** + * WithCustomUrl: + * - Purpose: Tests the page with a custom restart flow URL. + * - Scenario: Simulates a page expired scenario with a specific URL to restart the authentication flow. + * - Key Aspect: Ensures the "click here to login" link points to the correct restart URL. + */ +export const WithCustomUrl: Story = { + render: () => ( + + ) +}; diff --git a/src/login/pages/LoginPageExpired.tsx b/src/login/pages/LoginPageExpired.tsx new file mode 100644 index 00000000..749a824c --- /dev/null +++ b/src/login/pages/LoginPageExpired.tsx @@ -0,0 +1,47 @@ +import type { PageProps } from "keycloakify/login/pages/PageProps"; +import type { KcContext } from "../KcContext"; +import type { I18n } from "../i18n"; +import { fr } from "@codegouvfr/react-dsfr"; + +export default function LoginPageExpired(props: PageProps, I18n>) { + const { kcContext, i18n, doUseDefaultCss, Template, classes } = props; + + const { url } = kcContext; + + const { msg } = i18n; + + return ( + + ); +}