mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-18 11:29:26 +03:00
17da90df6c
* web: Clarify required marker when using screen reader. * web: Mark helper text as input descriptor. * web: Use next domain when in development. * web: Clean up constants. Fix attribute mapping. * web: use previous function name. * web: Fix sort. * web: Use constant. * web: Use prefix. * web: keep using current release for notes.
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
import "#elements/CodeMirror";
|
|
import "#elements/forms/HorizontalFormElement";
|
|
|
|
import { DEFAULT_CONFIG } from "#common/api/config";
|
|
|
|
import { BasePropertyMappingForm } from "#admin/property-mappings/BasePropertyMappingForm";
|
|
|
|
import { OAuthSourcePropertyMapping, PropertymappingsApi } from "@goauthentik/api";
|
|
|
|
import { customElement } from "lit/decorators.js";
|
|
|
|
@customElement("ak-property-mapping-source-oauth-form")
|
|
export class PropertyMappingSourceOAuthForm extends BasePropertyMappingForm<OAuthSourcePropertyMapping> {
|
|
protected override docLink = "/users-sources/sources/property-mappings/expressions";
|
|
|
|
loadInstance(pk: string): Promise<OAuthSourcePropertyMapping> {
|
|
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourceOauthRetrieve({
|
|
pmUuid: pk,
|
|
});
|
|
}
|
|
|
|
async send(data: OAuthSourcePropertyMapping): Promise<OAuthSourcePropertyMapping> {
|
|
if (this.instance) {
|
|
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourceOauthUpdate({
|
|
pmUuid: this.instance.pk,
|
|
oAuthSourcePropertyMappingRequest: data,
|
|
});
|
|
}
|
|
return new PropertymappingsApi(DEFAULT_CONFIG).propertymappingsSourceOauthCreate({
|
|
oAuthSourcePropertyMappingRequest: data,
|
|
});
|
|
}
|
|
}
|
|
|
|
declare global {
|
|
interface HTMLElementTagNameMap {
|
|
"ak-property-mapping-source-oauth-form": PropertyMappingSourceOAuthForm;
|
|
}
|
|
}
|