From c1b14cb5eba0c192342c7036f7964c7fef9999d1 Mon Sep 17 00:00:00 2001 From: Alexander Petric Date: Sat, 5 Apr 2025 08:17:26 -0400 Subject: [PATCH] fix: tenant id to never be undefined on teams (#5572) * fix: tenant id to never be undefined * simplify azure oauth * simplify azure oauth * update ee ref * sqlx prepare * sqlx prepare --- ...4c79b3cbc6413046c3b6099d19f675d8a395b.json | 23 +++++++++++++++++++ ...5ef114772f7d2ee0f60cb1358cdb7f0b5cd0c.json | 23 ------------------- ...508835affcb7679a48f2a443777e829bd1e74.json | 10 ++++---- backend/ee-repo-ref.txt | 2 +- .../lib/components/AzureOauthSettings.svelte | 2 +- .../src/lib/components/OAuthSetting.svelte | 6 ++++- 6 files changed, 35 insertions(+), 31 deletions(-) create mode 100644 backend/.sqlx/query-f955a01779f5441efc6aa9364b24c79b3cbc6413046c3b6099d19f675d8a395b.json delete mode 100644 backend/.sqlx/query-fa59674af1d1a4ceb696fc883005ef114772f7d2ee0f60cb1358cdb7f0b5cd0c.json diff --git a/backend/.sqlx/query-f955a01779f5441efc6aa9364b24c79b3cbc6413046c3b6099d19f675d8a395b.json b/backend/.sqlx/query-f955a01779f5441efc6aa9364b24c79b3cbc6413046c3b6099d19f675d8a395b.json new file mode 100644 index 0000000000..925d8c39f1 --- /dev/null +++ b/backend/.sqlx/query-f955a01779f5441efc6aa9364b24c79b3cbc6413046c3b6099d19f675d8a395b.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT EXISTS (SELECT 1\n FROM workspace_settings\n WHERE workspace_id <> $1\n AND slack_command_script IS NOT NULL\n AND slack_team_id = $2\n AND (SELECT slack_command_script IS NOT NULL FROM workspace_settings WHERE workspace_id = $1))\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "exists", + "type_info": "Bool" + } + ], + "parameters": { + "Left": [ + "Text", + "Text" + ] + }, + "nullable": [ + null + ] + }, + "hash": "f955a01779f5441efc6aa9364b24c79b3cbc6413046c3b6099d19f675d8a395b" +} diff --git a/backend/.sqlx/query-fa59674af1d1a4ceb696fc883005ef114772f7d2ee0f60cb1358cdb7f0b5cd0c.json b/backend/.sqlx/query-fa59674af1d1a4ceb696fc883005ef114772f7d2ee0f60cb1358cdb7f0b5cd0c.json deleted file mode 100644 index 917a0910cc..0000000000 --- a/backend/.sqlx/query-fa59674af1d1a4ceb696fc883005ef114772f7d2ee0f60cb1358cdb7f0b5cd0c.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT EXISTS (SELECT 1 \n FROM workspace_settings \n WHERE workspace_id <> $1 \n AND slack_command_script IS NOT NULL\n AND slack_team_id = $2\n AND (SELECT slack_command_script IS NOT NULL FROM workspace_settings WHERE workspace_id = $1))\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "exists", - "type_info": "Bool" - } - ], - "parameters": { - "Left": [ - "Text", - "Text" - ] - }, - "nullable": [ - null - ] - }, - "hash": "fa59674af1d1a4ceb696fc883005ef114772f7d2ee0f60cb1358cdb7f0b5cd0c" -} diff --git a/backend/.sqlx/query-fec6d5674dc6b5a6a0ece419c40508835affcb7679a48f2a443777e829bd1e74.json b/backend/.sqlx/query-fec6d5674dc6b5a6a0ece419c40508835affcb7679a48f2a443777e829bd1e74.json index 649ab85650..de2e819af2 100644 --- a/backend/.sqlx/query-fec6d5674dc6b5a6a0ece419c40508835affcb7679a48f2a443777e829bd1e74.json +++ b/backend/.sqlx/query-fec6d5674dc6b5a6a0ece419c40508835affcb7679a48f2a443777e829bd1e74.json @@ -41,11 +41,11 @@ ] }, "nullable": [ - false, - false, - false, - false, - false, + true, + true, + true, + true, + true, true ] }, diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index 933b24a492..fa6472967e 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -94cbac33756c1fba56da037456f44a4d294475b1 \ No newline at end of file +619f7dcd1097bfcd2f8b85f2075782219ff76be1 \ No newline at end of file diff --git a/frontend/src/lib/components/AzureOauthSettings.svelte b/frontend/src/lib/components/AzureOauthSettings.svelte index 8cb7cb91c8..47f6390a82 100644 --- a/frontend/src/lib/components/AzureOauthSettings.svelte +++ b/frontend/src/lib/components/AzureOauthSettings.svelte @@ -10,7 +10,7 @@ extra_params: { tenant_id: string } extra_params_callback: Record } = { - scopes: [], + scopes: ['offline_access'], auth_url: '', token_url: '', req_body_auth: true, diff --git a/frontend/src/lib/components/OAuthSetting.svelte b/frontend/src/lib/components/OAuthSetting.svelte index ad097fd7c1..5d25c26ead 100644 --- a/frontend/src/lib/components/OAuthSetting.svelte +++ b/frontend/src/lib/components/OAuthSetting.svelte @@ -71,7 +71,11 @@ disabled={eeOnly && !$enterpriseLicense} on:change={(e) => { if (e.detail) { - value = { id: '', secret: '' } + if (name === 'teams' || name === 'microsoft') { + value = { id: '', secret: '', tenant: '' } + } else { + value = { id: '', secret: '' } + } } else { value = undefined }