Add delete-credential.ftl page
This commit is contained in:
parent
58dfd3c25c
commit
3eeba99152
@ -17,7 +17,7 @@ const isSilent = true;
|
|||||||
const logger = getLogger({ isSilent });
|
const logger = getLogger({ isSilent });
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const keycloakVersion = "24.0.2";
|
const keycloakVersion = "24.0.4";
|
||||||
|
|
||||||
const thisCodebaseRootDirPath = getThisCodebaseRootDirPath();
|
const thisCodebaseRootDirPath = getThisCodebaseRootDirPath();
|
||||||
|
|
||||||
|
@ -24,7 +24,8 @@ export const loginThemePageIds = [
|
|||||||
"idp-review-user-profile.ftl",
|
"idp-review-user-profile.ftl",
|
||||||
"update-email.ftl",
|
"update-email.ftl",
|
||||||
"select-authenticator.ftl",
|
"select-authenticator.ftl",
|
||||||
"saml-post-form.ftl"
|
"saml-post-form.ftl",
|
||||||
|
"delete-credential.ftl"
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export const accountThemePageIds = [
|
export const accountThemePageIds = [
|
||||||
|
@ -31,6 +31,7 @@ const IdpReviewUserProfile = lazy(() => import("keycloakify/login/pages/IdpRevie
|
|||||||
const UpdateEmail = lazy(() => import("keycloakify/login/pages/UpdateEmail"));
|
const UpdateEmail = lazy(() => import("keycloakify/login/pages/UpdateEmail"));
|
||||||
const SelectAuthenticator = lazy(() => import("keycloakify/login/pages/SelectAuthenticator"));
|
const SelectAuthenticator = lazy(() => import("keycloakify/login/pages/SelectAuthenticator"));
|
||||||
const SamlPostForm = lazy(() => import("keycloakify/login/pages/SamlPostForm"));
|
const SamlPostForm = lazy(() => import("keycloakify/login/pages/SamlPostForm"));
|
||||||
|
const DeleteCredential = lazy(() => import("keycloakify/login/pages/DeleteCredential"));
|
||||||
|
|
||||||
type FallbackProps = PageProps<KcContext, I18n> & {
|
type FallbackProps = PageProps<KcContext, I18n> & {
|
||||||
UserProfileFormFields: LazyOrNot<(props: UserProfileFormFieldsProps) => JSX.Element>;
|
UserProfileFormFields: LazyOrNot<(props: UserProfileFormFieldsProps) => JSX.Element>;
|
||||||
@ -94,6 +95,8 @@ export default function Fallback(props: FallbackProps) {
|
|||||||
return <SelectAuthenticator kcContext={kcContext} {...rest} />;
|
return <SelectAuthenticator kcContext={kcContext} {...rest} />;
|
||||||
case "saml-post-form.ftl":
|
case "saml-post-form.ftl":
|
||||||
return <SamlPostForm kcContext={kcContext} {...rest} />;
|
return <SamlPostForm kcContext={kcContext} {...rest} />;
|
||||||
|
case "delete-credential.ftl":
|
||||||
|
return <DeleteCredential kcContext={kcContext} {...rest} />;
|
||||||
}
|
}
|
||||||
assert<Equals<typeof kcContext, never>>(false);
|
assert<Equals<typeof kcContext, never>>(false);
|
||||||
})()}
|
})()}
|
||||||
|
@ -34,7 +34,8 @@ export type KcContext =
|
|||||||
| KcContext.IdpReviewUserProfile
|
| KcContext.IdpReviewUserProfile
|
||||||
| KcContext.UpdateEmail
|
| KcContext.UpdateEmail
|
||||||
| KcContext.SelectAuthenticator
|
| KcContext.SelectAuthenticator
|
||||||
| KcContext.SamlPostForm;
|
| KcContext.SamlPostForm
|
||||||
|
| KcContext.DeleteCredential;
|
||||||
|
|
||||||
assert<KcContext["themeType"] extends ThemeType ? true : false>();
|
assert<KcContext["themeType"] extends ThemeType ? true : false>();
|
||||||
|
|
||||||
@ -489,6 +490,17 @@ export declare namespace KcContext {
|
|||||||
| "kcAuthenticatorWebAuthnPasswordlessClass";
|
| "kcAuthenticatorWebAuthnPasswordlessClass";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type DeleteCredential = Common & {
|
||||||
|
pageId: "delete-credential.ftl";
|
||||||
|
credentialLabel: string;
|
||||||
|
/*
|
||||||
|
credential: {
|
||||||
|
id: string;
|
||||||
|
userLabel: string;
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Attribute = {
|
export type Attribute = {
|
||||||
|
45
src/login/pages/DeleteCredential.tsx
Normal file
45
src/login/pages/DeleteCredential.tsx
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import { clsx } from "keycloakify/tools/clsx";
|
||||||
|
import type { PageProps } from "keycloakify/login/pages/PageProps";
|
||||||
|
import type { KcContext } from "../kcContext";
|
||||||
|
import type { I18n } from "../i18n";
|
||||||
|
import { useGetClassName } from "keycloakify/login/lib/useGetClassName";
|
||||||
|
|
||||||
|
export default function DeleteCredential(props: PageProps<Extract<KcContext, { pageId: "delete-credential.ftl" }>, I18n>) {
|
||||||
|
const { kcContext, i18n, doUseDefaultCss, Template, classes } = props;
|
||||||
|
|
||||||
|
const { msgStr, msg } = i18n;
|
||||||
|
|
||||||
|
const { getClassName } = useGetClassName({
|
||||||
|
doUseDefaultCss,
|
||||||
|
classes
|
||||||
|
});
|
||||||
|
|
||||||
|
const { url, credentialLabel } = kcContext;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Template
|
||||||
|
{...{ kcContext, i18n, doUseDefaultCss, classes }}
|
||||||
|
displayMessage={false}
|
||||||
|
headerNode={msg("deleteCredentialTitle", credentialLabel)}
|
||||||
|
>
|
||||||
|
<div id="kc-delete-text">{msg("deleteCredentialMessage", credentialLabel)}</div>
|
||||||
|
<form className="form-actions" action={url.loginAction} method="POST">
|
||||||
|
<input
|
||||||
|
className={clsx(getClassName("kcButtonClass"), getClassName("kcButtonPrimaryClass"), getClassName("kcButtonLargeClass"))}
|
||||||
|
name="accept"
|
||||||
|
id="kc-accept"
|
||||||
|
type="submit"
|
||||||
|
value={msgStr("doConfirmDelete")}
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
className={clsx(getClassName("kcButtonClass"), getClassName("kcButtonDefaultClass"), getClassName("kcButtonLargeClass"))}
|
||||||
|
name="cancel-aia"
|
||||||
|
value={msgStr("doCancel")}
|
||||||
|
id="kc-decline"
|
||||||
|
type="submit"
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
|
<div className="clearfix" />
|
||||||
|
</Template>
|
||||||
|
);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user