From 27573729b659f1f12c71f58bec0904a9c1533e1b Mon Sep 17 00:00:00 2001 From: nael Date: Thu, 2 May 2024 02:33:00 +0200 Subject: [PATCH] :page_facing_up: Update npm packages --- .changeset/angry-items-stare.md | 5 +++++ .changeset/sharp-taxis-dance.md | 6 ++++++ apps/embedded-catalog/react/src/hooks/useOAuth.tsx | 4 ++-- packages/shared/src/authUrl.ts | 3 --- 4 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 .changeset/angry-items-stare.md create mode 100644 .changeset/sharp-taxis-dance.md diff --git a/.changeset/angry-items-stare.md b/.changeset/angry-items-stare.md new file mode 100644 index 000000000..2a0c8e899 --- /dev/null +++ b/.changeset/angry-items-stare.md @@ -0,0 +1,5 @@ +--- +"@panora/shared": patch +--- + +Patch diff --git a/.changeset/sharp-taxis-dance.md b/.changeset/sharp-taxis-dance.md new file mode 100644 index 000000000..dbb7e1c1f --- /dev/null +++ b/.changeset/sharp-taxis-dance.md @@ -0,0 +1,6 @@ +--- +"@panora/embedded-card-react": patch +"@panora/shared": patch +--- + +patch fix diff --git a/apps/embedded-catalog/react/src/hooks/useOAuth.tsx b/apps/embedded-catalog/react/src/hooks/useOAuth.tsx index da3df47d2..5f7b64811 100644 --- a/apps/embedded-catalog/react/src/hooks/useOAuth.tsx +++ b/apps/embedded-catalog/react/src/hooks/useOAuth.tsx @@ -5,11 +5,11 @@ import { constructAuthUrl } from '@panora/shared'; type UseOAuthProps = { clientId?: string; providerName: string; // Name of the OAuth provider - vertical: string; + vertical: string; // Vertical (Crm, Ticketing, etc) returnUrl: string; // Return URL after OAuth flow projectId: string; // Project ID linkedUserId: string; // Linked User ID - optionalApiUrl?: string; // URL of the User's Server + optionalApiUrl?: string; // URL of the User's Server onSuccess: () => void; }; diff --git a/packages/shared/src/authUrl.ts b/packages/shared/src/authUrl.ts index e80f6a277..f3ff616df 100644 --- a/packages/shared/src/authUrl.ts +++ b/packages/shared/src/authUrl.ts @@ -1,6 +1,5 @@ import { OAuth2AuthData, providerToType } from './envConfig'; import { AuthStrategy, providersConfig, ProviderConfig } from './utils'; - interface AuthParams { projectId: string; linkedUserId: string; @@ -25,10 +24,8 @@ const randomString = () => { export const constructAuthUrl = async ({ projectId, linkedUserId, providerName, returnUrl, apiUrl, vertical }: AuthParams) => { const encodedRedirectUrl = encodeURIComponent(`${apiUrl}/connections/oauth/callback`); const state = encodeURIComponent(JSON.stringify({ projectId, linkedUserId, providerName, vertical, returnUrl })); - // console.log('State : ', JSON.stringify({ projectId, linkedUserId, providerName, vertical, returnUrl })); // console.log('encodedRedirect URL : ', encodedRedirectUrl); - // const vertical = findProviderVertical(providerName); if (vertical == null) { throw new Error('vertical is null');