Add delete-account-confirm.ftl page
This commit is contained in:
parent
93d90d0ba6
commit
34e1621b84
@ -27,7 +27,8 @@ export const loginThemePageIds = [
|
||||
"select-authenticator.ftl",
|
||||
"saml-post-form.ftl",
|
||||
"delete-credential.ftl",
|
||||
"code.ftl"
|
||||
"code.ftl",
|
||||
"delete-account-confirm.ftl"
|
||||
] as const;
|
||||
|
||||
export const accountThemePageIds = [
|
||||
|
@ -33,6 +33,7 @@ const SelectAuthenticator = lazy(() => import("keycloakify/login/pages/SelectAut
|
||||
const SamlPostForm = lazy(() => import("keycloakify/login/pages/SamlPostForm"));
|
||||
const DeleteCredential = lazy(() => import("keycloakify/login/pages/DeleteCredential"));
|
||||
const Code = lazy(() => import("keycloakify/login/pages/Code"));
|
||||
const DeleteAccountConfirm = lazy(() => import("keycloakify/login/pages/DeleteAccountConfirm"));
|
||||
|
||||
type FallbackProps = PageProps<KcContext, I18n> & {
|
||||
UserProfileFormFields: LazyOrNot<(props: UserProfileFormFieldsProps) => JSX.Element>;
|
||||
@ -101,6 +102,8 @@ export default function Fallback(props: FallbackProps) {
|
||||
return <DeleteCredential kcContext={kcContext} {...rest} />;
|
||||
case "code.ftl":
|
||||
return <Code kcContext={kcContext} {...rest} />;
|
||||
case "delete-account-confirm.ftl":
|
||||
return <DeleteAccountConfirm kcContext={kcContext} {...rest} />;
|
||||
}
|
||||
assert<Equals<typeof kcContext, never>>(false);
|
||||
})()}
|
||||
|
@ -37,7 +37,8 @@ export type KcContext =
|
||||
| KcContext.SelectAuthenticator
|
||||
| KcContext.SamlPostForm
|
||||
| KcContext.DeleteCredential
|
||||
| KcContext.Code;
|
||||
| KcContext.Code
|
||||
| KcContext.DeleteAccountConfirm;
|
||||
|
||||
assert<KcContext["themeType"] extends ThemeType ? true : false>();
|
||||
|
||||
@ -507,6 +508,11 @@ export declare namespace KcContext {
|
||||
error?: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type DeleteAccountConfirm = Common & {
|
||||
pageId: "delete-account-confirm.ftl";
|
||||
triggered_from_aia: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export type UserProfile = {
|
||||
|
53
src/login/pages/DeleteAccountConfirm.tsx
Normal file
53
src/login/pages/DeleteAccountConfirm.tsx
Normal file
@ -0,0 +1,53 @@
|
||||
import { clsx } from "keycloakify/tools/clsx";
|
||||
import type { PageProps } from "keycloakify/login/pages/PageProps";
|
||||
import { useGetClassName } from "keycloakify/login/lib/useGetClassName";
|
||||
import type { KcContext } from "../kcContext";
|
||||
import type { I18n } from "../i18n";
|
||||
|
||||
export default function DeleteAccountConfirm(props: PageProps<Extract<KcContext, { pageId: "delete-account-confirm.ftl" }>, I18n>) {
|
||||
const { kcContext, i18n, doUseDefaultCss, Template, classes } = props;
|
||||
|
||||
const { getClassName } = useGetClassName({
|
||||
doUseDefaultCss,
|
||||
classes
|
||||
});
|
||||
|
||||
const { url, triggered_from_aia } = kcContext;
|
||||
|
||||
const { msg, msgStr } = i18n;
|
||||
|
||||
return (
|
||||
<Template {...{ kcContext, i18n, doUseDefaultCss, classes }} headerNode={msg("deleteAccountConfirm")}>
|
||||
<form action={url.loginAction} className="form-vertical" method="post">
|
||||
<div className="alert alert-warning" style={{ "marginTop": "0", "marginBottom": "30px" }}>
|
||||
<span className="pficon pficon-warning-triangle-o"></span>
|
||||
{msg("irreversibleAction")}
|
||||
</div>
|
||||
<p>{msg("deletingImplies")}</p>
|
||||
<ul style={{ "color": "#72767b", "listStyle": "disc", "listStylePosition": "inside" }}>
|
||||
<li>{msg("loggingOutImmediately")}</li>
|
||||
<li>{msg("errasingData")}</li>
|
||||
</ul>
|
||||
<p className="delete-account-text">{msg("finalDeletionConfirmation")}</p>
|
||||
<div id="kc-form-buttons">
|
||||
<input
|
||||
className={clsx(getClassName("kcButtonClass"), getClassName("kcButtonPrimaryClass"), getClassName("kcButtonLargeClass"))}
|
||||
type="submit"
|
||||
value={msgStr("doConfirmDelete")}
|
||||
/>
|
||||
{triggered_from_aia && (
|
||||
<button
|
||||
className={clsx(getClassName("kcButtonClass"), getClassName("kcButtonDefaultClass"), getClassName("kcButtonLargeClass"))}
|
||||
style={{ "marginLeft": "calc(100% - 220px)" }}
|
||||
type="submit"
|
||||
name="cancel-aia"
|
||||
value="true"
|
||||
>
|
||||
{msgStr("doCancel")}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</form>
|
||||
</Template>
|
||||
);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user