Set restAuthType

This commit is contained in:
Adria Navarro 2025-03-17 12:03:37 +01:00
parent d6f59e056a
commit 72c47d1b18
2 changed files with 7 additions and 3 deletions

View File

@ -646,6 +646,7 @@
<AuthPicker
bind:authConfigId={query.fields.authConfigId}
bind:authConfigType={query.fields.authConfigType}
{authConfigs}
datasourceId={datasource._id}
/>

View File

@ -12,12 +12,13 @@
import { appStore, oauth2 } from "@/stores/builder"
import DetailPopover from "@/components/common/DetailPopover.svelte"
import { featureFlag } from "@/helpers"
import { FeatureFlag } from "@budibase/types"
import { FeatureFlag, RestAuthType } from "@budibase/types"
import { onMount } from "svelte"
type Config = { label: string; value: string }
export let authConfigId: string | undefined
export let authConfigType: RestAuthType | undefined
export let authConfigs: Config[]
export let datasourceId: string
@ -43,11 +44,13 @@
$goto(`/builder/app/${$appStore.appId}/settings/oauth2`)
}
function selectConfiguration(id: string) {
function selectConfiguration(id: string, type?: RestAuthType) {
if (authConfigId === id) {
authConfigId = undefined
authConfigType = undefined
} else {
authConfigId = id
authConfigType = type
}
popover.hide()
}
@ -105,7 +108,7 @@
{#each $oauth2.configs as config}
<ListItem
title={config.name}
on:click={() => selectConfiguration(config.id)}
on:click={() => selectConfiguration(config.id, RestAuthType.OAUTH2)}
selected={config.id === authConfigId}
/>
{/each}