From c3c7316ec0f81ab8a35e106d7239d6de02deac7b Mon Sep 17 00:00:00 2001 From: nafees nazik Date: Wed, 18 Oct 2023 22:15:48 +0530 Subject: [PATCH] feat: add to redirect provider --- .../src/views/IntegrationsPage/IntegrationPage.utils.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/IntegrationsPage/IntegrationPage.utils.tsx b/frontend/src/views/IntegrationsPage/IntegrationPage.utils.tsx index c9fa6c5852..5e92ec4eeb 100644 --- a/frontend/src/views/IntegrationsPage/IntegrationPage.utils.tsx +++ b/frontend/src/views/IntegrationsPage/IntegrationPage.utils.tsx @@ -1,6 +1,6 @@ import crypto from "crypto"; -import { TCloudIntegration,UserWsKeyPair } from "@app/hooks/api/types"; +import { TCloudIntegration, UserWsKeyPair } from "@app/hooks/api/types"; import { decryptAssymmetric, @@ -32,11 +32,10 @@ export const generateBotKey = (botPublicKey: string, latestKey: UserWsKeyPair) = export const redirectForProviderAuth = (integrationOption: TCloudIntegration) => { try { - // generate CSRF token for OAuth2 code-token exchange integrations const state = crypto.randomBytes(16).toString("hex"); localStorage.setItem("latestCSRFToken", state); - + let link = ""; switch (integrationOption.slug) { case "gcp-secret-manager": @@ -123,6 +122,9 @@ export const redirectForProviderAuth = (integrationOption: TCloudIntegration) => case "teamcity": link = `${window.location.origin}/integrations/teamcity/authorize`; break; + case "hasura-cloud": + link = `${window.location.origin}/integrations/hasura-cloud/authorize`; + break; default: break; } @@ -130,7 +132,6 @@ export const redirectForProviderAuth = (integrationOption: TCloudIntegration) => if (link !== "") { window.location.assign(link); } - } catch (err) { console.error(err); }