diff --git a/frontend/src/lib/components/AppConnect.svelte b/frontend/src/lib/components/AppConnect.svelte index 3d0fb256f4..8fd2b5aafc 100644 --- a/frontend/src/lib/components/AppConnect.svelte +++ b/frontend/src/lib/components/AppConnect.svelte @@ -1,8 +1,13 @@ @@ -28,6 +33,9 @@ let valueToken: TokenResponse let connects: Record }> = {} let connectsManual: [string, { img?: string; instructions: string }][] = [] + let key: string = 'token' + + $: key = apiTokenApps[resource_type]?.key ?? 'token' let scopes: string[] = [] let extra_params: [string, string][] = [] @@ -101,7 +109,7 @@ } let account: number | undefined = undefined - if (valueToken.refresh_token != undefined && valueToken.expires_in != undefined) { + if (valueToken?.refresh_token != undefined && valueToken?.expires_in != undefined) { account = Number( await OauthService.createAccount({ workspace: $workspaceStore!, @@ -125,12 +133,14 @@ account: account } }) + const resourceValue = {} + resourceValue[key] = `$var:${path}` await ResourceService.createResource({ workspace: $workspaceStore!, requestBody: { resource_type, path, - value: { token: `$var:${path}` }, + value: resourceValue, description: `OAuth token for ${resource_type}`, is_oauth: true } diff --git a/frontend/static/discord_webhook.png b/frontend/static/discord_webhook.png new file mode 100644 index 0000000000..363c1fc0f1 Binary files /dev/null and b/frontend/static/discord_webhook.png differ