web/admin: always override send method instead of assigning (#5426)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -51,7 +51,7 @@ export class LDAPSourceForm extends ModelForm<LDAPSource, string> {
|
||||
}
|
||||
}
|
||||
|
||||
send = (data: LDAPSource): Promise<LDAPSource> => {
|
||||
async send(data: LDAPSource): Promise<LDAPSource> {
|
||||
if (this.instance) {
|
||||
return new SourcesApi(DEFAULT_CONFIG).sourcesLdapPartialUpdate({
|
||||
slug: this.instance.slug,
|
||||
@ -62,7 +62,7 @@ export class LDAPSourceForm extends ModelForm<LDAPSource, string> {
|
||||
lDAPSourceRequest: data as unknown as LDAPSourceRequest,
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
renderForm(): TemplateResult {
|
||||
return html`<form class="pf-c-form pf-m-horizontal">
|
||||
|
||||
@ -71,7 +71,7 @@ export class OAuthSourceForm extends ModelForm<OAuthSource, string> {
|
||||
}
|
||||
}
|
||||
|
||||
send = async (data: OAuthSource): Promise<OAuthSource> => {
|
||||
async send(data: OAuthSource): Promise<OAuthSource> {
|
||||
data.providerType = (this.providerType?.slug || "") as ProviderTypeEnum;
|
||||
let source: OAuthSource;
|
||||
if (this.instance) {
|
||||
@ -103,7 +103,7 @@ export class OAuthSourceForm extends ModelForm<OAuthSource, string> {
|
||||
});
|
||||
}
|
||||
return source;
|
||||
};
|
||||
}
|
||||
|
||||
renderUrlOptions(): TemplateResult {
|
||||
if (!this.providerType?.urlsCustomizable) {
|
||||
|
||||
@ -61,7 +61,7 @@ export class PlexSourceForm extends ModelForm<PlexSource, string> {
|
||||
}
|
||||
}
|
||||
|
||||
send = async (data: PlexSource): Promise<PlexSource> => {
|
||||
async send(data: PlexSource): Promise<PlexSource> {
|
||||
data.plexToken = this.plexToken || "";
|
||||
let source: PlexSource;
|
||||
if (this.instance?.pk) {
|
||||
@ -93,7 +93,7 @@ export class PlexSourceForm extends ModelForm<PlexSource, string> {
|
||||
});
|
||||
}
|
||||
return source;
|
||||
};
|
||||
}
|
||||
|
||||
async doAuth(): Promise<void> {
|
||||
const authInfo = await PlexAPIClient.getPin(this.instance?.clientId || "");
|
||||
|
||||
@ -54,7 +54,7 @@ export class SAMLSourceForm extends ModelForm<SAMLSource, string> {
|
||||
}
|
||||
}
|
||||
|
||||
send = async (data: SAMLSource): Promise<SAMLSource> => {
|
||||
async send(data: SAMLSource): Promise<SAMLSource> {
|
||||
let source: SAMLSource;
|
||||
if (this.instance) {
|
||||
source = await new SourcesApi(DEFAULT_CONFIG).sourcesSamlUpdate({
|
||||
@ -85,7 +85,7 @@ export class SAMLSourceForm extends ModelForm<SAMLSource, string> {
|
||||
});
|
||||
}
|
||||
return source;
|
||||
};
|
||||
}
|
||||
|
||||
renderForm(): TemplateResult {
|
||||
return html`<form class="pf-c-form pf-m-horizontal">
|
||||
|
||||
Reference in New Issue
Block a user