diff --git a/src/login/pages/Login.stories.tsx b/src/login/pages/Login.stories.tsx index d7a842ee..f14cfd13 100644 --- a/src/login/pages/Login.stories.tsx +++ b/src/login/pages/Login.stories.tsx @@ -138,6 +138,33 @@ export const WithFranceConnectAndProConnectProviders: Story = { ) }; +export const WithFranceConnectNotOnFirstPosition: Story = { + render: () => ( + + ) +}; + export const WithGitHub: Story = { render: () => ( , I18n>) { const { kcContext, i18n, doUseDefaultCss, Template, classes } = props; @@ -23,7 +24,7 @@ export default function Login(props: PageProps
-
    - {social.providers.map((...[p]) => { - if (p.providerId === "agentconnect" || p.providerId === "proconnect") { - return ; - } +
    + {social.providers + .map((p, index) => { + if (p.providerId === "agentconnect" || p.providerId === "proconnect") { + return ; + } - if (p.providerId === "franceconnect") { - return ; - } + if (franceConnectProviderIds.includes(p.providerId)) { + if (index !== 0) { + throw new Error('Le bouton FranceConnect doit être le premier bouton de connexion'); + } + return ( + <> +

    + FranceConnect est la solution proposée par l’État pour sécuriser et simplifier la connexion à + vos services en ligne. +

    + + + ); + } - return ( - - ); - })} -
+ return ( +
+ +
+ ); + }) + .map((value, index) => { + if (index >= 1 && franceConnectProviderIds.includes(social.providers?.[0].providerId ?? '')) { + return ( + <> +
OU
+ {value} + + ); + } + return value; + })} + )} @@ -103,7 +132,7 @@ export default function Login(props: PageProps
- {social?.providers !== undefined && social.providers.length !== 0 &&

{msg("or-login-with-email")}

} + {social?.providers !== undefined && social.providers.length !== 0 &&

{msg("or-login-with-email")}

} {realm.password && (