diff --git a/web/src/admin/applications/ApplicationCheckAccessForm.ts b/web/src/admin/applications/ApplicationCheckAccessForm.ts index ea5f6937c..7d74e8e8f 100644 --- a/web/src/admin/applications/ApplicationCheckAccessForm.ts +++ b/web/src/admin/applications/ApplicationCheckAccessForm.ts @@ -34,14 +34,14 @@ export class ApplicationCheckAccessForm extends Form<{ forUser: number }> { return t`Successfully sent test-request.`; } - send = async (data: { forUser: number }): Promise => { + async send(data: { forUser: number }): Promise { this.request = data.forUser; const result = await new CoreApi(DEFAULT_CONFIG).coreApplicationsCheckAccessRetrieve({ slug: this.application?.slug, forUser: data.forUser, }); return (this.result = result); - }; + } resetForm(): void { super.resetForm(); diff --git a/web/src/admin/applications/ApplicationForm.ts b/web/src/admin/applications/ApplicationForm.ts index e10d7d75c..268cc504b 100644 --- a/web/src/admin/applications/ApplicationForm.ts +++ b/web/src/admin/applications/ApplicationForm.ts @@ -49,7 +49,7 @@ export class ApplicationForm extends ModelForm { } } - send = async (data: Application): Promise => { + async send(data: Application): Promise { let app: Application; if (this.instance) { app = await new CoreApi(DEFAULT_CONFIG).coreApplicationsUpdate({ @@ -80,7 +80,7 @@ export class ApplicationForm extends ModelForm { }); } return app; - }; + } renderForm(): TemplateResult { return html`
diff --git a/web/src/admin/blueprints/BlueprintForm.ts b/web/src/admin/blueprints/BlueprintForm.ts index 21508d623..a9f16eea4 100644 --- a/web/src/admin/blueprints/BlueprintForm.ts +++ b/web/src/admin/blueprints/BlueprintForm.ts @@ -63,7 +63,7 @@ export class BlueprintForm extends ModelForm { ); } - send = (data: BlueprintInstance): Promise => { + async send(data: BlueprintInstance): Promise { if (this.instance?.pk) { return new ManagedApi(DEFAULT_CONFIG).managedBlueprintsUpdate({ instanceUuid: this.instance.pk, @@ -74,7 +74,7 @@ export class BlueprintForm extends ModelForm { blueprintInstanceRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/crypto/CertificateGenerateForm.ts b/web/src/admin/crypto/CertificateGenerateForm.ts index 7ccf46f29..2a7bd69aa 100644 --- a/web/src/admin/crypto/CertificateGenerateForm.ts +++ b/web/src/admin/crypto/CertificateGenerateForm.ts @@ -15,11 +15,11 @@ export class CertificateKeyPairForm extends Form { return t`Successfully generated certificate-key pair.`; } - send = (data: CertificateGenerationRequest): Promise => { + async send(data: CertificateGenerationRequest): Promise { return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsGenerateCreate({ certificateGenerationRequest: data, }); - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/crypto/CertificateKeyPairForm.ts b/web/src/admin/crypto/CertificateKeyPairForm.ts index b598562e5..26a7928c3 100644 --- a/web/src/admin/crypto/CertificateKeyPairForm.ts +++ b/web/src/admin/crypto/CertificateKeyPairForm.ts @@ -27,7 +27,7 @@ export class CertificateKeyPairForm extends ModelForm => { + async send(data: CertificateKeyPair): Promise { if (this.instance) { return new CryptoApi(DEFAULT_CONFIG).cryptoCertificatekeypairsPartialUpdate({ kpUuid: this.instance.pk || "", @@ -38,7 +38,7 @@ export class CertificateKeyPairForm extends ModelForm diff --git a/web/src/admin/events/RuleForm.ts b/web/src/admin/events/RuleForm.ts index 50bd501b3..4f0c35888 100644 --- a/web/src/admin/events/RuleForm.ts +++ b/web/src/admin/events/RuleForm.ts @@ -44,7 +44,7 @@ export class RuleForm extends ModelForm { } } - send = (data: NotificationRule): Promise => { + async send(data: NotificationRule): Promise { if (this.instance) { return new EventsApi(DEFAULT_CONFIG).eventsRulesUpdate({ pbmUuid: this.instance.pk || "", @@ -55,7 +55,7 @@ export class RuleForm extends ModelForm { notificationRuleRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/events/TransportForm.ts b/web/src/admin/events/TransportForm.ts index 2080b127c..614f5dcdd 100644 --- a/web/src/admin/events/TransportForm.ts +++ b/web/src/admin/events/TransportForm.ts @@ -44,7 +44,7 @@ export class TransportForm extends ModelForm { } } - send = (data: NotificationTransport): Promise => { + async send(data: NotificationTransport): Promise { if (this.instance) { return new EventsApi(DEFAULT_CONFIG).eventsTransportsUpdate({ uuid: this.instance.pk || "", @@ -55,7 +55,7 @@ export class TransportForm extends ModelForm { notificationTransportRequest: data, }); } - }; + } onModeChange(mode: string | undefined): void { if ( diff --git a/web/src/admin/flows/FlowForm.ts b/web/src/admin/flows/FlowForm.ts index 4d626b2b6..56e417c84 100644 --- a/web/src/admin/flows/FlowForm.ts +++ b/web/src/admin/flows/FlowForm.ts @@ -45,7 +45,7 @@ export class FlowForm extends ModelForm { @property({ type: Boolean }) clearBackground = false; - send = async (data: Flow): Promise => { + async send(data: Flow): Promise { let flow: Flow; if (this.instance) { flow = await new FlowsApi(DEFAULT_CONFIG).flowsInstancesUpdate({ @@ -76,7 +76,7 @@ export class FlowForm extends ModelForm { }); } return flow; - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/flows/FlowImportForm.ts b/web/src/admin/flows/FlowImportForm.ts index 8f576abbf..099ac8632 100644 --- a/web/src/admin/flows/FlowImportForm.ts +++ b/web/src/admin/flows/FlowImportForm.ts @@ -26,7 +26,7 @@ export class FlowImportForm extends Form { return super.styles.concat(PFDescriptionList); } - send = async (): Promise => { + async send(): Promise { const file = this.getFormFiles()["flow"]; if (!file) { throw new SentryIgnoredError("No form data"); @@ -39,7 +39,7 @@ export class FlowImportForm extends Form { throw new SentryIgnoredError("Failed to import flow"); } return result; - }; + } renderResult(): TemplateResult { return html` diff --git a/web/src/admin/groups/GroupForm.ts b/web/src/admin/groups/GroupForm.ts index 9ceb6c6cc..c7ea57816 100644 --- a/web/src/admin/groups/GroupForm.ts +++ b/web/src/admin/groups/GroupForm.ts @@ -44,7 +44,7 @@ export class GroupForm extends ModelForm { } } - send = (data: Group): Promise => { + async send(data: Group): Promise { if (this.instance?.pk) { return new CoreApi(DEFAULT_CONFIG).coreGroupsPartialUpdate({ groupUuid: this.instance.pk, @@ -56,7 +56,7 @@ export class GroupForm extends ModelForm { groupRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/outposts/OutpostForm.ts b/web/src/admin/outposts/OutpostForm.ts index f93627df6..9a845a49f 100644 --- a/web/src/admin/outposts/OutpostForm.ts +++ b/web/src/admin/outposts/OutpostForm.ts @@ -86,7 +86,7 @@ export class OutpostForm extends ModelForm { } } - send = (data: Outpost): Promise => { + async send(data: Outpost): Promise { if (this.instance) { return new OutpostsApi(DEFAULT_CONFIG).outpostsInstancesUpdate({ uuid: this.instance.pk || "", @@ -97,7 +97,7 @@ export class OutpostForm extends ModelForm { outpostRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/outposts/ServiceConnectionDockerForm.ts b/web/src/admin/outposts/ServiceConnectionDockerForm.ts index 0a023c58c..93a1ba481 100644 --- a/web/src/admin/outposts/ServiceConnectionDockerForm.ts +++ b/web/src/admin/outposts/ServiceConnectionDockerForm.ts @@ -34,7 +34,7 @@ export class ServiceConnectionDockerForm extends ModelForm => { + async send(data: DockerServiceConnection): Promise { if (this.instance) { return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsDockerUpdate({ uuid: this.instance.pk || "", @@ -45,7 +45,7 @@ export class ServiceConnectionDockerForm extends ModelForm diff --git a/web/src/admin/outposts/ServiceConnectionKubernetesForm.ts b/web/src/admin/outposts/ServiceConnectionKubernetesForm.ts index 60063f546..21e8a5551 100644 --- a/web/src/admin/outposts/ServiceConnectionKubernetesForm.ts +++ b/web/src/admin/outposts/ServiceConnectionKubernetesForm.ts @@ -32,7 +32,7 @@ export class ServiceConnectionKubernetesForm extends ModelForm< } } - send = (data: KubernetesServiceConnection): Promise => { + async send(data: KubernetesServiceConnection): Promise { if (this.instance) { return new OutpostsApi(DEFAULT_CONFIG).outpostsServiceConnectionsKubernetesUpdate({ uuid: this.instance.pk || "", @@ -43,7 +43,7 @@ export class ServiceConnectionKubernetesForm extends ModelForm< kubernetesServiceConnectionRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/policies/PolicyTestForm.ts b/web/src/admin/policies/PolicyTestForm.ts index 9549a6389..75e47e1e5 100644 --- a/web/src/admin/policies/PolicyTestForm.ts +++ b/web/src/admin/policies/PolicyTestForm.ts @@ -39,14 +39,14 @@ export class PolicyTestForm extends Form { return t`Successfully sent test-request.`; } - send = async (data: PolicyTestRequest): Promise => { + async send(data: PolicyTestRequest): Promise { this.request = data; const result = await new PoliciesApi(DEFAULT_CONFIG).policiesAllTestCreate({ policyUuid: this.policy?.pk || "", policyTestRequest: data, }); return (this.result = result); - }; + } static get styles(): CSSResult[] { return super.styles.concat(PFDescriptionList); diff --git a/web/src/admin/policies/dummy/DummyPolicyForm.ts b/web/src/admin/policies/dummy/DummyPolicyForm.ts index ef81d8e55..6f42a25a3 100644 --- a/web/src/admin/policies/dummy/DummyPolicyForm.ts +++ b/web/src/admin/policies/dummy/DummyPolicyForm.ts @@ -28,7 +28,7 @@ export class DummyPolicyForm extends ModelForm { } } - send = (data: DummyPolicy): Promise => { + async send(data: DummyPolicy): Promise { if (this.instance) { return new PoliciesApi(DEFAULT_CONFIG).policiesDummyUpdate({ policyUuid: this.instance.pk || "", @@ -39,7 +39,7 @@ export class DummyPolicyForm extends ModelForm { dummyPolicyRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/policies/event_matcher/EventMatcherPolicyForm.ts b/web/src/admin/policies/event_matcher/EventMatcherPolicyForm.ts index cb42a789b..16da71901 100644 --- a/web/src/admin/policies/event_matcher/EventMatcherPolicyForm.ts +++ b/web/src/admin/policies/event_matcher/EventMatcherPolicyForm.ts @@ -42,7 +42,7 @@ export class EventMatcherPolicyForm extends ModelForm => { + async send(data: EventMatcherPolicy): Promise { if (this.instance) { return new PoliciesApi(DEFAULT_CONFIG).policiesEventMatcherUpdate({ policyUuid: this.instance.pk || "", @@ -53,7 +53,7 @@ export class EventMatcherPolicyForm extends ModelForm diff --git a/web/src/admin/policies/expiry/ExpiryPolicyForm.ts b/web/src/admin/policies/expiry/ExpiryPolicyForm.ts index 3238fb1ec..7ea3fff4b 100644 --- a/web/src/admin/policies/expiry/ExpiryPolicyForm.ts +++ b/web/src/admin/policies/expiry/ExpiryPolicyForm.ts @@ -28,7 +28,7 @@ export class PasswordExpiryPolicyForm extends ModelForm => { + async send(data: PasswordExpiryPolicy): Promise { if (this.instance) { return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordExpiryUpdate({ policyUuid: this.instance.pk || "", @@ -39,7 +39,7 @@ export class PasswordExpiryPolicyForm extends ModelForm diff --git a/web/src/admin/policies/expression/ExpressionPolicyForm.ts b/web/src/admin/policies/expression/ExpressionPolicyForm.ts index 45cdd0b94..80f20dc72 100644 --- a/web/src/admin/policies/expression/ExpressionPolicyForm.ts +++ b/web/src/admin/policies/expression/ExpressionPolicyForm.ts @@ -30,7 +30,7 @@ export class ExpressionPolicyForm extends ModelForm { } } - send = (data: ExpressionPolicy): Promise => { + async send(data: ExpressionPolicy): Promise { if (this.instance) { return new PoliciesApi(DEFAULT_CONFIG).policiesExpressionUpdate({ policyUuid: this.instance.pk || "", @@ -41,7 +41,7 @@ export class ExpressionPolicyForm extends ModelForm { expressionPolicyRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/policies/password/PasswordPolicyForm.ts b/web/src/admin/policies/password/PasswordPolicyForm.ts index cb37d706e..0f87d1005 100644 --- a/web/src/admin/policies/password/PasswordPolicyForm.ts +++ b/web/src/admin/policies/password/PasswordPolicyForm.ts @@ -44,7 +44,7 @@ export class PasswordPolicyForm extends ModelForm { } } - send = (data: PasswordPolicy): Promise => { + async send(data: PasswordPolicy): Promise { if (this.instance) { return new PoliciesApi(DEFAULT_CONFIG).policiesPasswordUpdate({ policyUuid: this.instance.pk || "", @@ -55,7 +55,7 @@ export class PasswordPolicyForm extends ModelForm { passwordPolicyRequest: data, }); } - }; + } renderStaticRules(): TemplateResult { return html` diff --git a/web/src/admin/policies/reputation/ReputationPolicyForm.ts b/web/src/admin/policies/reputation/ReputationPolicyForm.ts index deaba070a..d12aa24e6 100644 --- a/web/src/admin/policies/reputation/ReputationPolicyForm.ts +++ b/web/src/admin/policies/reputation/ReputationPolicyForm.ts @@ -28,7 +28,7 @@ export class ReputationPolicyForm extends ModelForm { } } - send = (data: ReputationPolicy): Promise => { + async send(data: ReputationPolicy): Promise { if (this.instance) { return new PoliciesApi(DEFAULT_CONFIG).policiesReputationUpdate({ policyUuid: this.instance.pk || "", @@ -39,7 +39,7 @@ export class ReputationPolicyForm extends ModelForm { reputationPolicyRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/property-mappings/PropertyMappingLDAPForm.ts b/web/src/admin/property-mappings/PropertyMappingLDAPForm.ts index 947a4b6e1..cd2ca42eb 100644 --- a/web/src/admin/property-mappings/PropertyMappingLDAPForm.ts +++ b/web/src/admin/property-mappings/PropertyMappingLDAPForm.ts @@ -28,7 +28,7 @@ export class PropertyMappingLDAPForm extends ModelForm => { + async send(data: LDAPPropertyMapping): Promise { if (this.instance) { return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsLdapUpdate({ pmUuid: this.instance.pk || "", @@ -39,7 +39,7 @@ export class PropertyMappingLDAPForm extends ModelForm diff --git a/web/src/admin/property-mappings/PropertyMappingNotification.ts b/web/src/admin/property-mappings/PropertyMappingNotification.ts index d6426e18a..ba1c971d5 100644 --- a/web/src/admin/property-mappings/PropertyMappingNotification.ts +++ b/web/src/admin/property-mappings/PropertyMappingNotification.ts @@ -28,7 +28,7 @@ export class PropertyMappingNotification extends ModelForm => { + async send(data: NotificationWebhookMapping): Promise { if (this.instance) { return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsNotificationUpdate({ pmUuid: this.instance.pk || "", @@ -39,7 +39,7 @@ export class PropertyMappingNotification extends ModelForm diff --git a/web/src/admin/property-mappings/PropertyMappingSAMLForm.ts b/web/src/admin/property-mappings/PropertyMappingSAMLForm.ts index 44367a8c6..ec0d5eea1 100644 --- a/web/src/admin/property-mappings/PropertyMappingSAMLForm.ts +++ b/web/src/admin/property-mappings/PropertyMappingSAMLForm.ts @@ -28,7 +28,7 @@ export class PropertyMappingSAMLForm extends ModelForm => { + async send(data: SAMLPropertyMapping): Promise { if (this.instance) { return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSamlUpdate({ pmUuid: this.instance.pk || "", @@ -39,7 +39,7 @@ export class PropertyMappingSAMLForm extends ModelForm diff --git a/web/src/admin/property-mappings/PropertyMappingSCIMForm.ts b/web/src/admin/property-mappings/PropertyMappingSCIMForm.ts index 63d86d746..01b357507 100644 --- a/web/src/admin/property-mappings/PropertyMappingSCIMForm.ts +++ b/web/src/admin/property-mappings/PropertyMappingSCIMForm.ts @@ -28,7 +28,7 @@ export class PropertyMappingSCIMForm extends ModelForm { } } - send = (data: SCIMMapping): Promise => { + async send(data: SCIMMapping): Promise { if (this.instance) { return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsScimUpdate({ pmUuid: this.instance.pk || "", @@ -39,7 +39,7 @@ export class PropertyMappingSCIMForm extends ModelForm { sCIMMappingRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/property-mappings/PropertyMappingScopeForm.ts b/web/src/admin/property-mappings/PropertyMappingScopeForm.ts index 0e045abeb..69da06478 100644 --- a/web/src/admin/property-mappings/PropertyMappingScopeForm.ts +++ b/web/src/admin/property-mappings/PropertyMappingScopeForm.ts @@ -28,7 +28,7 @@ export class PropertyMappingScopeForm extends ModelForm { } } - send = (data: ScopeMapping): Promise => { + async send(data: ScopeMapping): Promise { if (this.instance) { return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsScopeUpdate({ pmUuid: this.instance.pk || "", @@ -39,7 +39,7 @@ export class PropertyMappingScopeForm extends ModelForm { scopeMappingRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/property-mappings/PropertyMappingTestForm.ts b/web/src/admin/property-mappings/PropertyMappingTestForm.ts index d0108e993..e76e93861 100644 --- a/web/src/admin/property-mappings/PropertyMappingTestForm.ts +++ b/web/src/admin/property-mappings/PropertyMappingTestForm.ts @@ -37,7 +37,7 @@ export class PolicyTestForm extends Form { return t`Successfully sent test-request.`; } - send = async (data: PolicyTestRequest): Promise => { + async send(data: PolicyTestRequest): Promise { this.request = data; const result = await new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsAllTestCreate({ pmUuid: this.mapping?.pk || "", @@ -45,7 +45,7 @@ export class PolicyTestForm extends Form { formatResult: true, }); return (this.result = result); - }; + } renderResult(): TemplateResult { return html` diff --git a/web/src/admin/providers/ldap/LDAPProviderForm.ts b/web/src/admin/providers/ldap/LDAPProviderForm.ts index 4806481d3..c07097f83 100644 --- a/web/src/admin/providers/ldap/LDAPProviderForm.ts +++ b/web/src/admin/providers/ldap/LDAPProviderForm.ts @@ -46,7 +46,7 @@ export class LDAPProviderFormPage extends ModelForm { } } - send = (data: LDAPProvider): Promise => { + async send(data: LDAPProvider): Promise { if (this.instance) { return new ProvidersApi(DEFAULT_CONFIG).providersLdapUpdate({ id: this.instance.pk || 0, @@ -58,7 +58,7 @@ export class LDAPProviderFormPage extends ModelForm { lDAPProviderRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/providers/oauth2/OAuth2ProviderForm.ts b/web/src/admin/providers/oauth2/OAuth2ProviderForm.ts index b925aa0ec..5a7cdd2a7 100644 --- a/web/src/admin/providers/oauth2/OAuth2ProviderForm.ts +++ b/web/src/admin/providers/oauth2/OAuth2ProviderForm.ts @@ -69,7 +69,7 @@ export class OAuth2ProviderFormPage extends ModelForm { } } - send = (data: OAuth2Provider): Promise => { + async send(data: OAuth2Provider): Promise { if (this.instance) { return new ProvidersApi(DEFAULT_CONFIG).providersOauth2Update({ id: this.instance.pk || 0, @@ -80,7 +80,7 @@ export class OAuth2ProviderFormPage extends ModelForm { oAuth2ProviderRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/providers/proxy/ProxyProviderForm.ts b/web/src/admin/providers/proxy/ProxyProviderForm.ts index 58b4700fa..8ea42b93e 100644 --- a/web/src/admin/providers/proxy/ProxyProviderForm.ts +++ b/web/src/admin/providers/proxy/ProxyProviderForm.ts @@ -90,7 +90,7 @@ export class ProxyProviderFormPage extends ModelForm { } } - send = (data: ProxyProvider): Promise => { + async send(data: ProxyProvider): Promise { data.mode = this.mode; if (this.mode !== ProxyMode.ForwardDomain) { data.cookieDomain = ""; @@ -105,7 +105,7 @@ export class ProxyProviderFormPage extends ModelForm { proxyProviderRequest: data, }); } - }; + } renderHttpBasic(): TemplateResult { return html` { } } - send = (data: RadiusProvider): Promise => { + async send(data: RadiusProvider): Promise { if (this.instance) { return new ProvidersApi(DEFAULT_CONFIG).providersRadiusUpdate({ id: this.instance.pk || 0, @@ -49,7 +49,7 @@ export class RadiusProviderFormPage extends ModelForm { radiusProviderRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/providers/saml/SAMLProviderForm.ts b/web/src/admin/providers/saml/SAMLProviderForm.ts index e0d7055ad..117fe653d 100644 --- a/web/src/admin/providers/saml/SAMLProviderForm.ts +++ b/web/src/admin/providers/saml/SAMLProviderForm.ts @@ -58,7 +58,7 @@ export class SAMLProviderFormPage extends ModelForm { } } - send = (data: SAMLProvider): Promise => { + async send(data: SAMLProvider): Promise { if (this.instance) { return new ProvidersApi(DEFAULT_CONFIG).providersSamlUpdate({ id: this.instance.pk || 0, @@ -69,7 +69,7 @@ export class SAMLProviderFormPage extends ModelForm { sAMLProviderRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/providers/saml/SAMLProviderImportForm.ts b/web/src/admin/providers/saml/SAMLProviderImportForm.ts index 4b7c47791..5aa8b4dbd 100644 --- a/web/src/admin/providers/saml/SAMLProviderImportForm.ts +++ b/web/src/admin/providers/saml/SAMLProviderImportForm.ts @@ -25,7 +25,7 @@ export class SAMLProviderImportForm extends Form { return t`Successfully imported provider.`; } - send = (data: SAMLProvider): Promise => { + async send(data: SAMLProvider): Promise { const file = this.getFormFiles()["metadata"]; if (!file) { throw new SentryIgnoredError("No form data"); @@ -35,7 +35,7 @@ export class SAMLProviderImportForm extends Form { name: data.name, authorizationFlow: data.authorizationFlow || "", }); - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/providers/scim/SCIMProviderForm.ts b/web/src/admin/providers/scim/SCIMProviderForm.ts index 3f7e4b66c..a9c45ee35 100644 --- a/web/src/admin/providers/scim/SCIMProviderForm.ts +++ b/web/src/admin/providers/scim/SCIMProviderForm.ts @@ -48,7 +48,7 @@ export class SCIMProviderFormPage extends ModelForm { } } - send = (data: SCIMProvider): Promise => { + async send(data: SCIMProvider): Promise { if (this.instance) { return new ProvidersApi(DEFAULT_CONFIG).providersScimUpdate({ id: this.instance.pk || 0, @@ -59,7 +59,7 @@ export class SCIMProviderFormPage extends ModelForm { sCIMProviderRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/sources/ldap/LDAPSourceForm.ts b/web/src/admin/sources/ldap/LDAPSourceForm.ts index f8df6fde3..bf6e9b979 100644 --- a/web/src/admin/sources/ldap/LDAPSourceForm.ts +++ b/web/src/admin/sources/ldap/LDAPSourceForm.ts @@ -51,7 +51,7 @@ export class LDAPSourceForm extends ModelForm { } } - send = (data: LDAPSource): Promise => { + async send(data: LDAPSource): Promise { if (this.instance) { return new SourcesApi(DEFAULT_CONFIG).sourcesLdapPartialUpdate({ slug: this.instance.slug, @@ -62,7 +62,7 @@ export class LDAPSourceForm extends ModelForm { lDAPSourceRequest: data as unknown as LDAPSourceRequest, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/sources/oauth/OAuthSourceForm.ts b/web/src/admin/sources/oauth/OAuthSourceForm.ts index a7f9c5e02..f2ed0aab7 100644 --- a/web/src/admin/sources/oauth/OAuthSourceForm.ts +++ b/web/src/admin/sources/oauth/OAuthSourceForm.ts @@ -71,7 +71,7 @@ export class OAuthSourceForm extends ModelForm { } } - send = async (data: OAuthSource): Promise => { + async send(data: OAuthSource): Promise { data.providerType = (this.providerType?.slug || "") as ProviderTypeEnum; let source: OAuthSource; if (this.instance) { @@ -103,7 +103,7 @@ export class OAuthSourceForm extends ModelForm { }); } return source; - }; + } renderUrlOptions(): TemplateResult { if (!this.providerType?.urlsCustomizable) { diff --git a/web/src/admin/sources/plex/PlexSourceForm.ts b/web/src/admin/sources/plex/PlexSourceForm.ts index 51c78fb0e..d779857dd 100644 --- a/web/src/admin/sources/plex/PlexSourceForm.ts +++ b/web/src/admin/sources/plex/PlexSourceForm.ts @@ -61,7 +61,7 @@ export class PlexSourceForm extends ModelForm { } } - send = async (data: PlexSource): Promise => { + async send(data: PlexSource): Promise { data.plexToken = this.plexToken || ""; let source: PlexSource; if (this.instance?.pk) { @@ -93,7 +93,7 @@ export class PlexSourceForm extends ModelForm { }); } return source; - }; + } async doAuth(): Promise { const authInfo = await PlexAPIClient.getPin(this.instance?.clientId || ""); diff --git a/web/src/admin/sources/saml/SAMLSourceForm.ts b/web/src/admin/sources/saml/SAMLSourceForm.ts index 87a4e20b2..1f132060b 100644 --- a/web/src/admin/sources/saml/SAMLSourceForm.ts +++ b/web/src/admin/sources/saml/SAMLSourceForm.ts @@ -54,7 +54,7 @@ export class SAMLSourceForm extends ModelForm { } } - send = async (data: SAMLSource): Promise => { + async send(data: SAMLSource): Promise { let source: SAMLSource; if (this.instance) { source = await new SourcesApi(DEFAULT_CONFIG).sourcesSamlUpdate({ @@ -85,7 +85,7 @@ export class SAMLSourceForm extends ModelForm { }); } return source; - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/stages/authenticator_duo/AuthenticatorDuoStageForm.ts b/web/src/admin/stages/authenticator_duo/AuthenticatorDuoStageForm.ts index 01cf8fbad..9cb486606 100644 --- a/web/src/admin/stages/authenticator_duo/AuthenticatorDuoStageForm.ts +++ b/web/src/admin/stages/authenticator_duo/AuthenticatorDuoStageForm.ts @@ -37,7 +37,7 @@ export class AuthenticatorDuoStageForm extends ModelForm => { + async send(data: AuthenticatorDuoStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorDuoPartialUpdate({ stageUuid: this.instance.pk || "", @@ -48,7 +48,7 @@ export class AuthenticatorDuoStageForm extends ModelForm diff --git a/web/src/admin/stages/authenticator_duo/DuoDeviceImportForm.ts b/web/src/admin/stages/authenticator_duo/DuoDeviceImportForm.ts index 906ca1623..b8ab67b75 100644 --- a/web/src/admin/stages/authenticator_duo/DuoDeviceImportForm.ts +++ b/web/src/admin/stages/authenticator_duo/DuoDeviceImportForm.ts @@ -34,13 +34,13 @@ export class DuoDeviceImportForm extends ModelForm => { + async send(data: AuthenticatorDuoStage): Promise { const importData = data as unknown as AuthenticatorDuoStageManualDeviceImportRequest; return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorDuoImportDeviceManualCreate({ stageUuid: this.instance?.pk || "", authenticatorDuoStageManualDeviceImportRequest: importData, }); - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/stages/authenticator_sms/AuthenticatorSMSStageForm.ts b/web/src/admin/stages/authenticator_sms/AuthenticatorSMSStageForm.ts index d50986c8c..aa8627dfc 100644 --- a/web/src/admin/stages/authenticator_sms/AuthenticatorSMSStageForm.ts +++ b/web/src/admin/stages/authenticator_sms/AuthenticatorSMSStageForm.ts @@ -54,7 +54,7 @@ export class AuthenticatorSMSStageForm extends ModelForm => { + async send(data: AuthenticatorSMSStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorSmsUpdate({ stageUuid: this.instance.pk || "", @@ -65,7 +65,7 @@ export class AuthenticatorSMSStageForm extends ModelForm => { + async send(data: AuthenticatorStaticStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorStaticUpdate({ stageUuid: this.instance.pk || "", @@ -46,7 +46,7 @@ export class AuthenticatorStaticStageForm extends ModelForm diff --git a/web/src/admin/stages/authenticator_totp/AuthenticatorTOTPStageForm.ts b/web/src/admin/stages/authenticator_totp/AuthenticatorTOTPStageForm.ts index bf6347b73..49550399f 100644 --- a/web/src/admin/stages/authenticator_totp/AuthenticatorTOTPStageForm.ts +++ b/web/src/admin/stages/authenticator_totp/AuthenticatorTOTPStageForm.ts @@ -37,7 +37,7 @@ export class AuthenticatorTOTPStageForm extends ModelForm => { + async send(data: AuthenticatorTOTPStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorTotpUpdate({ stageUuid: this.instance.pk || "", @@ -48,7 +48,7 @@ export class AuthenticatorTOTPStageForm extends ModelForm diff --git a/web/src/admin/stages/authenticator_validate/AuthenticatorValidateStageForm.ts b/web/src/admin/stages/authenticator_validate/AuthenticatorValidateStageForm.ts index 776873079..478373b25 100644 --- a/web/src/admin/stages/authenticator_validate/AuthenticatorValidateStageForm.ts +++ b/web/src/admin/stages/authenticator_validate/AuthenticatorValidateStageForm.ts @@ -50,7 +50,7 @@ export class AuthenticatorValidateStageForm extends ModelForm => { + async send(data: AuthenticatorValidateStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesAuthenticatorValidateUpdate({ stageUuid: this.instance.pk || "", @@ -61,7 +61,7 @@ export class AuthenticatorValidateStageForm extends ModelForm => { + async send(data: AuthenticateWebAuthnStage): Promise { if (data.authenticatorAttachment?.toString() === "") { data.authenticatorAttachment = null; } @@ -53,7 +53,7 @@ export class AuthenticateWebAuthnStageForm extends ModelForm diff --git a/web/src/admin/stages/captcha/CaptchaStageForm.ts b/web/src/admin/stages/captcha/CaptchaStageForm.ts index d9625aa21..4e49557d7 100644 --- a/web/src/admin/stages/captcha/CaptchaStageForm.ts +++ b/web/src/admin/stages/captcha/CaptchaStageForm.ts @@ -27,7 +27,7 @@ export class CaptchaStageForm extends ModelForm { } } - send = (data: CaptchaStage): Promise => { + async send(data: CaptchaStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesCaptchaPartialUpdate({ stageUuid: this.instance.pk || "", @@ -38,7 +38,7 @@ export class CaptchaStageForm extends ModelForm { captchaStageRequest: data as unknown as CaptchaStageRequest, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/stages/consent/ConsentStageForm.ts b/web/src/admin/stages/consent/ConsentStageForm.ts index 5cb8843da..d02d2b7d5 100644 --- a/web/src/admin/stages/consent/ConsentStageForm.ts +++ b/web/src/admin/stages/consent/ConsentStageForm.ts @@ -36,7 +36,7 @@ export class ConsentStageForm extends ModelForm { } } - send = (data: ConsentStage): Promise => { + async send(data: ConsentStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesConsentUpdate({ stageUuid: this.instance.pk || "", @@ -47,7 +47,7 @@ export class ConsentStageForm extends ModelForm { consentStageRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/stages/deny/DenyStageForm.ts b/web/src/admin/stages/deny/DenyStageForm.ts index 74f64b9c2..bb294679a 100644 --- a/web/src/admin/stages/deny/DenyStageForm.ts +++ b/web/src/admin/stages/deny/DenyStageForm.ts @@ -26,7 +26,7 @@ export class DenyStageForm extends ModelForm { } } - send = (data: DenyStage): Promise => { + async send(data: DenyStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesDenyUpdate({ stageUuid: this.instance.pk || "", @@ -37,7 +37,7 @@ export class DenyStageForm extends ModelForm { denyStageRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/stages/dummy/DummyStageForm.ts b/web/src/admin/stages/dummy/DummyStageForm.ts index 329efbf28..a5dfb4efb 100644 --- a/web/src/admin/stages/dummy/DummyStageForm.ts +++ b/web/src/admin/stages/dummy/DummyStageForm.ts @@ -27,7 +27,7 @@ export class DummyStageForm extends ModelForm { } } - send = (data: DummyStage): Promise => { + async send(data: DummyStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesDummyUpdate({ stageUuid: this.instance.pk || "", @@ -38,7 +38,7 @@ export class DummyStageForm extends ModelForm { dummyStageRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/stages/email/EmailStageForm.ts b/web/src/admin/stages/email/EmailStageForm.ts index 8e30f9bb1..e874fd827 100644 --- a/web/src/admin/stages/email/EmailStageForm.ts +++ b/web/src/admin/stages/email/EmailStageForm.ts @@ -39,7 +39,7 @@ export class EmailStageForm extends ModelForm { } } - send = (data: EmailStage): Promise => { + async send(data: EmailStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesEmailPartialUpdate({ stageUuid: this.instance.pk || "", @@ -50,7 +50,7 @@ export class EmailStageForm extends ModelForm { emailStageRequest: data, }); } - }; + } renderConnectionSettings(): TemplateResult { if (!this.showConnectionSettings) { diff --git a/web/src/admin/stages/identification/IdentificationStageForm.ts b/web/src/admin/stages/identification/IdentificationStageForm.ts index 9ab098c4f..ae4c76042 100644 --- a/web/src/admin/stages/identification/IdentificationStageForm.ts +++ b/web/src/admin/stages/identification/IdentificationStageForm.ts @@ -50,7 +50,7 @@ export class IdentificationStageForm extends ModelForm => { + async send(data: IdentificationStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesIdentificationUpdate({ stageUuid: this.instance.pk || "", @@ -61,7 +61,7 @@ export class IdentificationStageForm extends ModelForm { } } - send = (data: Invitation): Promise => { + async send(data: Invitation): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesInvitationInvitationsUpdate({ inviteUuid: this.instance.pk || "", @@ -48,7 +48,7 @@ export class InvitationForm extends ModelForm { invitationRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/stages/invitation/InvitationStageForm.ts b/web/src/admin/stages/invitation/InvitationStageForm.ts index a2267fdec..1ce1c85bd 100644 --- a/web/src/admin/stages/invitation/InvitationStageForm.ts +++ b/web/src/admin/stages/invitation/InvitationStageForm.ts @@ -27,7 +27,7 @@ export class InvitationStageForm extends ModelForm { } } - send = (data: InvitationStage): Promise => { + async send(data: InvitationStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesInvitationStagesUpdate({ stageUuid: this.instance.pk || "", @@ -38,7 +38,7 @@ export class InvitationStageForm extends ModelForm { invitationStageRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/stages/password/PasswordStageForm.ts b/web/src/admin/stages/password/PasswordStageForm.ts index 8f548c5db..a9943ab0f 100644 --- a/web/src/admin/stages/password/PasswordStageForm.ts +++ b/web/src/admin/stages/password/PasswordStageForm.ts @@ -38,7 +38,7 @@ export class PasswordStageForm extends ModelForm { } } - send = (data: PasswordStage): Promise => { + async send(data: PasswordStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesPasswordUpdate({ stageUuid: this.instance.pk || "", @@ -49,7 +49,7 @@ export class PasswordStageForm extends ModelForm { passwordStageRequest: data, }); } - }; + } isBackendSelected(field: BackendsEnum): boolean { if (!this.instance) { diff --git a/web/src/admin/stages/prompt/PromptStageForm.ts b/web/src/admin/stages/prompt/PromptStageForm.ts index dbf6d8ace..e8124a941 100644 --- a/web/src/admin/stages/prompt/PromptStageForm.ts +++ b/web/src/admin/stages/prompt/PromptStageForm.ts @@ -47,7 +47,7 @@ export class PromptStageForm extends ModelForm { } } - send = (data: PromptStage): Promise => { + async send(data: PromptStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesPromptStagesUpdate({ stageUuid: this.instance.pk || "", @@ -58,7 +58,7 @@ export class PromptStageForm extends ModelForm { promptStageRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/stages/user_delete/UserDeleteStageForm.ts b/web/src/admin/stages/user_delete/UserDeleteStageForm.ts index ea4fe296f..078ff7eb8 100644 --- a/web/src/admin/stages/user_delete/UserDeleteStageForm.ts +++ b/web/src/admin/stages/user_delete/UserDeleteStageForm.ts @@ -26,7 +26,7 @@ export class UserDeleteStageForm extends ModelForm { } } - send = (data: UserDeleteStage): Promise => { + async send(data: UserDeleteStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesUserDeleteUpdate({ stageUuid: this.instance.pk || "", @@ -37,7 +37,7 @@ export class UserDeleteStageForm extends ModelForm { userDeleteStageRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/stages/user_login/UserLoginStageForm.ts b/web/src/admin/stages/user_login/UserLoginStageForm.ts index e2837ce2f..5c4bc6ec3 100644 --- a/web/src/admin/stages/user_login/UserLoginStageForm.ts +++ b/web/src/admin/stages/user_login/UserLoginStageForm.ts @@ -29,7 +29,7 @@ export class UserLoginStageForm extends ModelForm { } } - send = (data: UserLoginStage): Promise => { + async send(data: UserLoginStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesUserLoginUpdate({ stageUuid: this.instance.pk || "", @@ -40,7 +40,7 @@ export class UserLoginStageForm extends ModelForm { userLoginStageRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/stages/user_logout/UserLogoutStageForm.ts b/web/src/admin/stages/user_logout/UserLogoutStageForm.ts index 5403a0533..4ddb4f851 100644 --- a/web/src/admin/stages/user_logout/UserLogoutStageForm.ts +++ b/web/src/admin/stages/user_logout/UserLogoutStageForm.ts @@ -26,7 +26,7 @@ export class UserLogoutStageForm extends ModelForm { } } - send = (data: UserLogoutStage): Promise => { + async send(data: UserLogoutStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesUserLogoutUpdate({ stageUuid: this.instance.pk || "", @@ -37,7 +37,7 @@ export class UserLogoutStageForm extends ModelForm { userLogoutStageRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/stages/user_write/UserWriteStageForm.ts b/web/src/admin/stages/user_write/UserWriteStageForm.ts index 3ecc2d4d6..93f019496 100644 --- a/web/src/admin/stages/user_write/UserWriteStageForm.ts +++ b/web/src/admin/stages/user_write/UserWriteStageForm.ts @@ -31,7 +31,7 @@ export class UserWriteStageForm extends ModelForm { } } - send = (data: UserWriteStage): Promise => { + async send(data: UserWriteStage): Promise { if (this.instance) { return new StagesApi(DEFAULT_CONFIG).stagesUserWriteUpdate({ stageUuid: this.instance.pk || "", @@ -42,7 +42,7 @@ export class UserWriteStageForm extends ModelForm { userWriteStageRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/tenants/TenantForm.ts b/web/src/admin/tenants/TenantForm.ts index 34b58c685..22288fabd 100644 --- a/web/src/admin/tenants/TenantForm.ts +++ b/web/src/admin/tenants/TenantForm.ts @@ -42,7 +42,7 @@ export class TenantForm extends ModelForm { } } - send = (data: Tenant): Promise => { + async send(data: Tenant): Promise { if (this.instance?.tenantUuid) { return new CoreApi(DEFAULT_CONFIG).coreTenantsUpdate({ tenantUuid: this.instance.tenantUuid, @@ -53,7 +53,7 @@ export class TenantForm extends ModelForm { tenantRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/tokens/TokenForm.ts b/web/src/admin/tokens/TokenForm.ts index 89ff304b8..d59c3cc61 100644 --- a/web/src/admin/tokens/TokenForm.ts +++ b/web/src/admin/tokens/TokenForm.ts @@ -29,7 +29,7 @@ export class TokenForm extends ModelForm { } } - send = (data: Token): Promise => { + async send(data: Token): Promise { if (this.instance?.identifier) { return new CoreApi(DEFAULT_CONFIG).coreTokensUpdate({ identifier: this.instance.identifier, @@ -40,7 +40,7 @@ export class TokenForm extends ModelForm { tokenRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/users/ServiceAccountForm.ts b/web/src/admin/users/ServiceAccountForm.ts index 66af4be9b..4707af7f3 100644 --- a/web/src/admin/users/ServiceAccountForm.ts +++ b/web/src/admin/users/ServiceAccountForm.ts @@ -21,14 +21,14 @@ export class ServiceAccountForm extends Form { return t`Successfully created user.`; } - send = async (data: UserServiceAccountRequest): Promise => { + async send(data: UserServiceAccountRequest): Promise { const result = await new CoreApi(DEFAULT_CONFIG).coreUsersServiceAccountCreate({ userServiceAccountRequest: data, }); this.result = result; (this.parentElement as ModalForm).showSubmitButton = false; return result; - }; + } resetForm(): void { super.resetForm(); diff --git a/web/src/admin/users/UserForm.ts b/web/src/admin/users/UserForm.ts index 46188dff9..b32b49c84 100644 --- a/web/src/admin/users/UserForm.ts +++ b/web/src/admin/users/UserForm.ts @@ -41,7 +41,7 @@ export class UserForm extends ModelForm { } } - send = (data: User): Promise => { + async send(data: User): Promise { if (this.instance?.pk) { return new CoreApi(DEFAULT_CONFIG).coreUsersPartialUpdate({ id: this.instance.pk, @@ -53,7 +53,7 @@ export class UserForm extends ModelForm { userRequest: data, }); } - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/users/UserPasswordForm.ts b/web/src/admin/users/UserPasswordForm.ts index b6de9eca0..b2429a6fd 100644 --- a/web/src/admin/users/UserPasswordForm.ts +++ b/web/src/admin/users/UserPasswordForm.ts @@ -19,12 +19,12 @@ export class UserPasswordForm extends Form { return t`Successfully updated password.`; } - send = (data: UserPasswordSetRequest): Promise => { + async send(data: UserPasswordSetRequest): Promise { return new CoreApi(DEFAULT_CONFIG).coreUsersSetPasswordCreate({ id: this.instancePk || 0, userPasswordSetRequest: data, }); - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/admin/users/UserResetEmailForm.ts b/web/src/admin/users/UserResetEmailForm.ts index e26d42738..123c440c8 100644 --- a/web/src/admin/users/UserResetEmailForm.ts +++ b/web/src/admin/users/UserResetEmailForm.ts @@ -27,10 +27,10 @@ export class UserResetEmailForm extends Form => { + async send(data: CoreUsersRecoveryEmailRetrieveRequest): Promise { data.id = this.user.pk; return new CoreApi(DEFAULT_CONFIG).coreUsersRecoveryEmailRetrieve(data); - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/user/user-settings/mfa/MFADeviceForm.ts b/web/src/user/user-settings/mfa/MFADeviceForm.ts index c3dfdc6bc..71ba52592 100644 --- a/web/src/user/user-settings/mfa/MFADeviceForm.ts +++ b/web/src/user/user-settings/mfa/MFADeviceForm.ts @@ -15,19 +15,18 @@ export class MFADeviceForm extends ModelForm { @property() deviceType!: string; - loadInstance(pk: number): Promise { - return new AuthenticatorsApi(DEFAULT_CONFIG).authenticatorsAllList().then((devices) => { - return devices.filter((device) => { - return device.pk === pk && device.type === this.deviceType; - })[0]; - }); + async loadInstance(pk: number): Promise { + const devices = await new AuthenticatorsApi(DEFAULT_CONFIG).authenticatorsAllList(); + return devices.filter((device) => { + return device.pk === pk && device.type === this.deviceType; + })[0]; } getSuccessMessage(): string { return t`Successfully updated device.`; } - send = async (device: Device): Promise => { + async send(device: Device): Promise { switch (this.instance?.type) { case "authentik_stages_authenticator_duo.DuoDevice": await new AuthenticatorsApi(DEFAULT_CONFIG).authenticatorsDuoUpdate({ @@ -63,7 +62,7 @@ export class MFADeviceForm extends ModelForm { break; } return device; - }; + } renderForm(): TemplateResult { return html` diff --git a/web/src/user/user-settings/tokens/UserTokenForm.ts b/web/src/user/user-settings/tokens/UserTokenForm.ts index 57fadf349..a8614b7d2 100644 --- a/web/src/user/user-settings/tokens/UserTokenForm.ts +++ b/web/src/user/user-settings/tokens/UserTokenForm.ts @@ -29,7 +29,7 @@ export class UserTokenForm extends ModelForm { } } - send = (data: Token): Promise => { + async send(data: Token): Promise { if (this.instance) { return new CoreApi(DEFAULT_CONFIG).coreTokensUpdate({ identifier: this.instance.identifier, @@ -41,7 +41,7 @@ export class UserTokenForm extends ModelForm { tokenRequest: data, }); } - }; + } renderForm(): TemplateResult { return html`