web: Clean up browser-only module imports that crash WebDriverIO. (#14330)
* web: Clean up browser-only module imports that crash WebDriverIO. * web: Clarify slug format output.
This commit is contained in:
@ -6,7 +6,6 @@ import {
|
||||
UserMatchingModeToLabel,
|
||||
} from "@goauthentik/admin/sources/oauth/utils";
|
||||
import { DEFAULT_CONFIG, config } from "@goauthentik/common/api/config";
|
||||
import { first } from "@goauthentik/common/utils";
|
||||
import "@goauthentik/components/ak-radio-input";
|
||||
import "@goauthentik/elements/CodeMirror";
|
||||
import { CodeMirrorMode } from "@goauthentik/elements/CodeMirror";
|
||||
@ -136,11 +135,9 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
>
|
||||
<input
|
||||
type="text"
|
||||
value="${first(
|
||||
this.instance?.authorizationUrl,
|
||||
this.providerType.authorizationUrl,
|
||||
"",
|
||||
)}"
|
||||
value="${this.instance?.authorizationUrl ??
|
||||
this.providerType.authorizationUrl ??
|
||||
""}"
|
||||
class="pf-c-form-control pf-m-monospace"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
@ -152,11 +149,9 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
<ak-form-element-horizontal label=${msg("Access token URL")} name="accessTokenUrl">
|
||||
<input
|
||||
type="url"
|
||||
value="${first(
|
||||
this.instance?.accessTokenUrl,
|
||||
this.providerType.accessTokenUrl,
|
||||
"",
|
||||
)}"
|
||||
value="${this.instance?.accessTokenUrl ??
|
||||
this.providerType.accessTokenUrl ??
|
||||
""}"
|
||||
class="pf-c-form-control pf-m-monospace"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
@ -168,11 +163,7 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
<ak-form-element-horizontal label=${msg("Profile URL")} name="profileUrl">
|
||||
<input
|
||||
type="url"
|
||||
value="${first(
|
||||
this.instance?.profileUrl,
|
||||
this.providerType.profileUrl,
|
||||
"",
|
||||
)}"
|
||||
value="${this.instance?.profileUrl ?? this.providerType.profileUrl ?? ""}"
|
||||
class="pf-c-form-control pf-m-monospace"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
@ -188,7 +179,7 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
>
|
||||
<input
|
||||
type="url"
|
||||
value="${first(this.instance?.requestTokenUrl, "")}"
|
||||
value="${this.instance?.requestTokenUrl ?? ""}"
|
||||
class="pf-c-form-control pf-m-monospace"
|
||||
autocomplete="off"
|
||||
/>
|
||||
@ -207,11 +198,9 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
>
|
||||
<input
|
||||
type="url"
|
||||
value="${first(
|
||||
this.instance?.oidcWellKnownUrl,
|
||||
this.providerType.oidcWellKnownUrl,
|
||||
"",
|
||||
)}"
|
||||
value="${this.instance?.oidcWellKnownUrl ??
|
||||
this.providerType.oidcWellKnownUrl ??
|
||||
""}"
|
||||
class="pf-c-form-control pf-m-monospace"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
@ -231,11 +220,9 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
>
|
||||
<input
|
||||
type="url"
|
||||
value="${first(
|
||||
this.instance?.oidcJwksUrl,
|
||||
this.providerType.oidcJwksUrl,
|
||||
"",
|
||||
)}"
|
||||
value="${this.instance?.oidcJwksUrl ??
|
||||
this.providerType.oidcJwksUrl ??
|
||||
""}"
|
||||
class="pf-c-form-control pf-m-monospace"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
@ -249,7 +236,7 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
<ak-form-element-horizontal label=${msg("OIDC JWKS")} name="oidcJwks">
|
||||
<ak-codemirror
|
||||
mode=${CodeMirrorMode.JavaScript}
|
||||
value="${JSON.stringify(first(this.instance?.oidcJwks, {}))}"
|
||||
value="${JSON.stringify(this.instance?.oidcJwks ?? {})}"
|
||||
>
|
||||
</ak-codemirror>
|
||||
<p class="pf-c-form__helper-text">${msg("Raw JWKS data.")}</p>
|
||||
@ -296,7 +283,7 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
<input
|
||||
class="pf-c-switch__input"
|
||||
type="checkbox"
|
||||
?checked=${first(this.instance?.enabled, true)}
|
||||
?checked=${this.instance?.enabled ?? true}
|
||||
/>
|
||||
<span class="pf-c-switch__toggle">
|
||||
<span class="pf-c-switch__toggle-icon">
|
||||
@ -381,10 +368,7 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
<ak-form-element-horizontal label=${msg("User path")} name="userPathTemplate">
|
||||
<input
|
||||
type="text"
|
||||
value="${first(
|
||||
this.instance?.userPathTemplate,
|
||||
"goauthentik.io/sources/%(slug)s",
|
||||
)}"
|
||||
value="${this.instance?.userPathTemplate ?? "goauthentik.io/sources/%(slug)s"}"
|
||||
class="pf-c-form-control pf-m-monospace"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
@ -432,7 +416,7 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
: html`<ak-form-element-horizontal label=${msg("Icon")} name="icon">
|
||||
<input
|
||||
type="text"
|
||||
value="${first(this.instance?.icon, "")}"
|
||||
value="${this.instance?.icon ?? ""}"
|
||||
class="pf-c-form-control pf-m-monospace"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
@ -474,7 +458,7 @@ export class OAuthSourceForm extends WithCapabilitiesConfig(BaseSourceForm<OAuth
|
||||
<ak-form-element-horizontal label=${msg("Scopes")} name="additionalScopes">
|
||||
<input
|
||||
type="text"
|
||||
value="${first(this.instance?.additionalScopes, "")}"
|
||||
value="${this.instance?.additionalScopes ?? ""}"
|
||||
class="pf-c-form-control pf-m-monospace"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
|
Reference in New Issue
Block a user