Update login-reset-password.ftl page
This commit is contained in:
parent
898a82cae1
commit
f228e50443
@ -222,10 +222,14 @@ export declare namespace KcContext {
|
|||||||
pageId: "login-reset-password.ftl";
|
pageId: "login-reset-password.ftl";
|
||||||
realm: {
|
realm: {
|
||||||
loginWithEmailAllowed: boolean;
|
loginWithEmailAllowed: boolean;
|
||||||
|
duplicateEmailsAllowed: boolean;
|
||||||
};
|
};
|
||||||
url: {
|
url: {
|
||||||
loginResetCredentialsUrl: string;
|
loginResetCredentialsUrl: string;
|
||||||
};
|
};
|
||||||
|
auth: {
|
||||||
|
attemptedUsername?: string;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export type LoginVerifyEmail = Common & {
|
export type LoginVerifyEmail = Common & {
|
||||||
|
@ -12,16 +12,17 @@ export default function LoginResetPassword(props: PageProps<Extract<KcContext, {
|
|||||||
classes
|
classes
|
||||||
});
|
});
|
||||||
|
|
||||||
const { url, realm, auth } = kcContext;
|
const { url, realm, auth, messagesPerField } = kcContext;
|
||||||
|
|
||||||
const { msg, msgStr } = i18n;
|
const { msg, msgStr } = i18n;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Template
|
<Template
|
||||||
{...{ kcContext, i18n, doUseDefaultCss, classes }}
|
{...{ kcContext, i18n, doUseDefaultCss, classes }}
|
||||||
displayMessage={false}
|
displayInfo
|
||||||
|
displayMessage={!messagesPerField.existsError("username")}
|
||||||
|
infoNode={realm.duplicateEmailsAllowed ? msg("emailInstructionUsername") : msg("emailInstruction")}
|
||||||
headerNode={msg("emailForgotTitle")}
|
headerNode={msg("emailForgotTitle")}
|
||||||
infoNode={msg("emailInstruction")}
|
|
||||||
>
|
>
|
||||||
<form id="kc-reset-password-form" className={getClassName("kcFormClass")} action={url.loginAction} method="post">
|
<form id="kc-reset-password-form" className={getClassName("kcFormClass")} action={url.loginAction} method="post">
|
||||||
<div className={getClassName("kcFormGroupClass")}>
|
<div className={getClassName("kcFormGroupClass")}>
|
||||||
@ -41,8 +42,14 @@ export default function LoginResetPassword(props: PageProps<Extract<KcContext, {
|
|||||||
name="username"
|
name="username"
|
||||||
className={getClassName("kcInputClass")}
|
className={getClassName("kcInputClass")}
|
||||||
autoFocus
|
autoFocus
|
||||||
defaultValue={auth !== undefined && auth.showUsername ? auth.attemptedUsername : undefined}
|
defaultValue={auth.attemptedUsername ?? ""}
|
||||||
|
aria-invalid={messagesPerField.existsError("username")}
|
||||||
/>
|
/>
|
||||||
|
{messagesPerField.existsError("username") && (
|
||||||
|
<span id="input-error-username" className={getClassName("kcInputErrorMessageClass")} aria-live="polite">
|
||||||
|
{messagesPerField.get("username")}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={clsx(getClassName("kcFormGroupClass"), getClassName("kcFormSettingClass"))}>
|
<div className={clsx(getClassName("kcFormGroupClass"), getClassName("kcFormSettingClass"))}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user