web: remove password hash form

This commit is contained in:
Dominic R
2026-04-22 20:21:26 -04:00
parent 7bb277c084
commit efd02e8f16
2 changed files with 0 additions and 70 deletions

View File

@@ -1,59 +0,0 @@
import "#elements/forms/HorizontalFormElement";
import { DEFAULT_CONFIG } from "#common/api/config";
import { Form } from "#elements/forms/Form";
import { CoreApi, UserPasswordHashSetRequest } from "@goauthentik/api";
import { msg } from "@lit/localize";
import { html, TemplateResult } from "lit";
import { customElement, property } from "lit/decorators.js";
@customElement("ak-user-password-hash-form")
export class UserPasswordHashForm extends Form<UserPasswordHashSetRequest> {
public override submitLabel = msg("Set Password");
@property({ type: Number })
public instancePk?: number;
public override getSuccessMessage(): string {
return msg("Successfully updated password.");
}
protected override async send(data: UserPasswordHashSetRequest): Promise<void> {
return new CoreApi(DEFAULT_CONFIG).coreUsersSetPasswordHashCreate({
id: this.instancePk || 0,
userPasswordHashSetRequest: data,
});
}
protected override renderForm(): TemplateResult {
return html`
<ak-form-element-horizontal label=${msg("Password hash")} required name="passwordHash">
<input
type="text"
value=""
class="pf-c-form-control"
required
placeholder=${msg("pbkdf2_sha256$...")}
aria-label=${msg("Password hash")}
/>
<p class="pf-c-form__helper-text">
${msg("Enter a pre-hashed password (e.g. pbkdf2_sha256$iterations$salt$hash).")}
</p>
<p class="pf-c-form__helper-text">
${msg(
"Warning: Password hashes set here are not synced back to LDAP or Kerberos.",
)}
</p>
</ak-form-element-horizontal>
`;
}
}
declare global {
interface HTMLElementTagNameMap {
"ak-user-password-hash-form": UserPasswordHashForm;
}
}

View File

@@ -3,7 +3,6 @@ import { LitFC } from "#elements/types";
import { getUserDisplayName } from "#elements/user/utils";
import { UserPasswordForm } from "#admin/users/UserPasswordForm";
import { UserPasswordHashForm } from "#admin/users/UserPasswordHashForm";
import { UserRecoveryLinkForm } from "#admin/users/UserRecoveryLinkForm";
import { UserResetEmailForm } from "#admin/users/UserResetEmailForm";
@@ -62,16 +61,6 @@ export const RecoveryButtons: LitFC<RecoveryButtonsProps> = ({
>
${msg("Set password")}
</button>`,
html`<button
class="pf-c-button pf-m-secondary ${buttonClasses || ""}"
type="button"
${modalInvoker(UserPasswordHashForm, {
headline: msg(str`Update ${getUserDisplayName(user)}'s password`),
instancePk: user.pk,
})}
>
${msg("Set password hash")}
</button>`,
...recoveryModals,
];
};