import { useEffect, useState } from "react"; import type { PageProps } from "keycloakify/login/pages/PageProps"; import type { KcContext } from "../kcContext"; import type { I18n } from "../i18n"; export default function SamlPostForm(props: PageProps, I18n>) { const { kcContext, i18n, doUseDefaultCss, Template, classes } = props; const { msgStr, msg } = i18n; const { samlPost } = kcContext; const [htmlFormElement, setHtmlFormElement] = useState(null); useEffect(() => { if (htmlFormElement === null) { return; } // Storybook if (samlPost.url === "") { alert("In a real Keycloak the user would be redirected immediately"); return; } htmlFormElement.submit(); }, [htmlFormElement]); return ( ); }