web/admin: adopt ak-hidden-text (#15042)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L.
2025-06-14 02:22:14 +02:00
committed by GitHub
parent 3c2ce40afd
commit 23b746941f
6 changed files with 28 additions and 34 deletions

View File

@ -4,6 +4,7 @@ import {
propertyMappingsSelector,
} from "@goauthentik/admin/providers/microsoft_entra/MicrosoftEntraProviderFormHelpers.js";
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import "@goauthentik/components/ak-hidden-text-input";
import "@goauthentik/elements/ak-dual-select/ak-dual-select-dynamic-selected-provider.js";
import "@goauthentik/elements/ak-dual-select/ak-dual-select-provider.js";
import "@goauthentik/elements/forms/FormGroup";
@ -68,21 +69,15 @@ export class MicrosoftEntraProviderFormPage extends BaseProviderForm<MicrosoftEn
${msg("Client ID for the app registration.")}
</p>
</ak-form-element-horizontal>
<ak-form-element-horizontal
label=${msg("Client Secret")}
required
<ak-hidden-text-input
name="clientSecret"
>
<input
type="text"
label=${msg("Client Secret")}
value="${this.instance?.clientSecret ?? ""}"
class="pf-c-form-control pf-m-monospace"
input-hint="code"
required
/>
<p class="pf-c-form__helper-text">
${msg("Client secret for the app registration.")}
</p>
</ak-form-element-horizontal>
.help=${msg("Client secret for the app registration.")}
>
</ak-hidden-text-input>
<ak-form-element-horizontal label=${msg("Tenant ID")} required name="tenantId">
<input
type="text"

View File

@ -5,6 +5,7 @@ import {
akOAuthRedirectURIInput,
} from "@goauthentik/admin/providers/oauth2/OAuth2ProviderRedirectURI";
import { ascii_letters, digits, randomString } from "@goauthentik/common/utils";
import "@goauthentik/components/ak-hidden-text-input";
import "@goauthentik/components/ak-radio-input";
import "@goauthentik/components/ak-text-input";
import "@goauthentik/components/ak-textarea-input";
@ -166,17 +167,16 @@ export function renderForm(
input-hint="code"
>
</ak-text-input>
<ak-text-input
<ak-hidden-text-input
name="clientSecret"
label=${msg("Client Secret")}
value="${provider?.clientSecret ?? randomString(128, ascii_letters + digits)}"
input-hint="code"
?hidden=${!showClientSecret}
>
</ak-text-input>
</ak-hidden-text-input>
<ak-form-element-horizontal
label=${msg("Redirect URIs/Origins (RegEx)")}
required
name="redirectUris"
>
<ak-array-input

View File

@ -1,6 +1,8 @@
import "@goauthentik/admin/common/ak-flow-search/ak-branded-flow-search";
import "@goauthentik/admin/common/ak-flow-search/ak-flow-search";
import { ascii_letters, digits, randomString } from "@goauthentik/common/utils";
import "@goauthentik/components/ak-hidden-text-input";
import "@goauthentik/components/ak-text-input";
import "@goauthentik/elements/forms/FormGroup";
import "@goauthentik/elements/forms/HorizontalFormElement";
import "@goauthentik/elements/forms/SearchSelect";
@ -74,14 +76,14 @@ export function renderForm(
<ak-form-group expanded>
<span slot="header"> ${msg("Protocol settings")} </span>
<div slot="body" class="pf-c-form">
<ak-text-input
<ak-hidden-text-input
name="sharedSecret"
label=${msg("Shared secret")}
.errorMessages=${errors?.sharedSecret ?? []}
value=${provider?.sharedSecret ?? randomString(128, ascii_letters + digits)}
required
input-hint="code"
></ak-text-input>
></ak-hidden-text-input>
<ak-text-input
name="clientNetworks"
label=${msg("Client Networks")}

View File

@ -1,4 +1,5 @@
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import "@goauthentik/components/ak-hidden-text-input";
import "@goauthentik/elements/ak-dual-select/ak-dual-select-dynamic-selected-provider.js";
import "@goauthentik/elements/forms/FormGroup";
import "@goauthentik/elements/forms/HorizontalFormElement";
@ -50,7 +51,7 @@ export function renderForm(provider?: Partial<SCIMProvider>, errors: ValidationE
>
</ak-switch-input>
<ak-text-input
<ak-hidden-text-input
name="token"
label=${msg("Token")}
value="${provider?.token ?? ""}"
@ -60,7 +61,7 @@ export function renderForm(provider?: Partial<SCIMProvider>, errors: ValidationE
"Token to authenticate with. Currently only bearer authentication is supported.",
)}
input-hint="code"
></ak-text-input>
></ak-hidden-text-input>
<ak-radio-input
name="compatibilityMode"
label=${msg("Compatibility Mode")}

View File

@ -128,7 +128,7 @@ export class PlexSourceForm extends WithCapabilitiesConfig(BaseSourceForm<PlexSo
this.doAuth();
}}
>
${msg("Re-authenticate with plex")}
${msg("Re-authenticate with Plex")}
</button>
<ak-form-element-horizontal name="allowFriends">
<label class="pf-c-switch">

View File

@ -1,5 +1,6 @@
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
import { dateTimeLocal } from "@goauthentik/common/temporal";
import "@goauthentik/components/ak-hidden-text-input";
import { Form } from "@goauthentik/elements/forms/Form";
import "@goauthentik/elements/forms/HorizontalFormElement";
import { ModalForm } from "@goauthentik/elements/forms/ModalForm";
@ -124,19 +125,14 @@ export class ServiceAccountForm extends Form<UserServiceAccountRequest> {
class="pf-c-form-control"
/>
</ak-form-element-horizontal>
<ak-form-element-horizontal label=${msg("Password")}>
<input
type="text"
readonly
value=${ifDefined(this.result?.token)}
class="pf-c-form-control"
/>
<p class="pf-c-form__helper-text">
${msg(
<ak-hidden-text-input
label=${msg("Password")}
value="${this.result?.token ?? ""}"
.help=${msg(
"Valid for 360 days, after which the password will automatically rotate. You can copy the password from the Token List.",
)}
</p>
</ak-form-element-horizontal>
>
</ak-hidden-text-input>
</form>`;
}