mirror of
https://github.com/goauthentik/authentik
synced 2026-04-25 17:15:26 +02:00
web: remove password hash form
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user