UNPKG

@keycloakify/keycloak-admin-ui

Version:
15 lines 2.74 kB
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; import { FormGroup } from "@patternfly/react-core"; import { useFormContext } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { HelpItem, TextControl } from "../../ui-shared"; import { MultiLineInput } from "../../components/multi-line-input/MultiLineInput"; import { convertAttributeNameToForm } from "../../util"; export const LoginSettings = ({ protocol = "openid-connect", }) => { const { t } = useTranslation(); const { watch } = useFormContext(); const standardFlowEnabled = watch("standardFlowEnabled"); const implicitFlowEnabled = watch("implicitFlowEnabled"); return (_jsxs(_Fragment, { children: [_jsx(TextControl, { type: "url", name: "rootUrl", label: t("rootUrl"), labelIcon: t("rootURLHelp") }), _jsx(TextControl, { type: "url", name: "baseUrl", label: t("homeURL"), labelIcon: t("homeURLHelp") }), (standardFlowEnabled || implicitFlowEnabled) && (_jsxs(_Fragment, { children: [_jsx(FormGroup, { label: t("validRedirectUri"), fieldId: "kc-redirect", labelIcon: _jsx(HelpItem, { helpText: t("validRedirectURIsHelp"), fieldLabelId: "validRedirectUri" }), children: _jsx(MultiLineInput, { id: "kc-redirect", name: "redirectUris", "aria-label": t("validRedirectUri"), addButtonLabel: "addRedirectUri" }) }), _jsx(FormGroup, { label: t("validPostLogoutRedirectUri"), fieldId: "kc-postLogoutRedirect", labelIcon: _jsx(HelpItem, { helpText: t("validPostLogoutRedirectURIsHelp"), fieldLabelId: "validPostLogoutRedirectUri" }), children: _jsx(MultiLineInput, { id: "kc-postLogoutRedirect", name: convertAttributeNameToForm("attributes.post.logout.redirect.uris"), "aria-label": t("validPostLogoutRedirectUri"), addButtonLabel: "addPostLogoutRedirectUri", stringify: true }) })] })), protocol === "saml" && (_jsxs(_Fragment, { children: [_jsx(TextControl, { name: "attributes.saml_idp_initiated_sso_url_name", label: t("idpInitiatedSsoUrlName"), labelIcon: t("idpInitiatedSsoUrlNameHelp") }), _jsx(TextControl, { name: "attributes.saml_idp_initiated_sso_relay_state", label: t("idpInitiatedSsoRelayState"), labelIcon: t("idpInitiatedSsoRelayStateHelp") }), _jsx(TextControl, { type: "url", name: "adminUrl", label: t("masterSamlProcessingUrl"), labelIcon: t("masterSamlProcessingUrlHelp") })] })), protocol !== "saml" && standardFlowEnabled && (_jsx(FormGroup, { label: t("webOrigins"), fieldId: "kc-web-origins", labelIcon: _jsx(HelpItem, { helpText: t("webOriginsHelp"), fieldLabelId: "webOrigins" }), children: _jsx(MultiLineInput, { id: "kc-web-origins", name: "webOrigins", "aria-label": t("webOrigins"), addButtonLabel: "addWebOrigins" }) }))] })); }; //# sourceMappingURL=LoginSettings.js.map