mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 17:26:19 +00:00
feat: add to redirect provider
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
|
|
||||||
import { TCloudIntegration,UserWsKeyPair } from "@app/hooks/api/types";
|
import { TCloudIntegration, UserWsKeyPair } from "@app/hooks/api/types";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
decryptAssymmetric,
|
decryptAssymmetric,
|
||||||
@@ -32,7 +32,6 @@ export const generateBotKey = (botPublicKey: string, latestKey: UserWsKeyPair) =
|
|||||||
|
|
||||||
export const redirectForProviderAuth = (integrationOption: TCloudIntegration) => {
|
export const redirectForProviderAuth = (integrationOption: TCloudIntegration) => {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// generate CSRF token for OAuth2 code-token exchange integrations
|
// generate CSRF token for OAuth2 code-token exchange integrations
|
||||||
const state = crypto.randomBytes(16).toString("hex");
|
const state = crypto.randomBytes(16).toString("hex");
|
||||||
localStorage.setItem("latestCSRFToken", state);
|
localStorage.setItem("latestCSRFToken", state);
|
||||||
@@ -123,6 +122,9 @@ export const redirectForProviderAuth = (integrationOption: TCloudIntegration) =>
|
|||||||
case "teamcity":
|
case "teamcity":
|
||||||
link = `${window.location.origin}/integrations/teamcity/authorize`;
|
link = `${window.location.origin}/integrations/teamcity/authorize`;
|
||||||
break;
|
break;
|
||||||
|
case "hasura-cloud":
|
||||||
|
link = `${window.location.origin}/integrations/hasura-cloud/authorize`;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -130,7 +132,6 @@ export const redirectForProviderAuth = (integrationOption: TCloudIntegration) =>
|
|||||||
if (link !== "") {
|
if (link !== "") {
|
||||||
window.location.assign(link);
|
window.location.assign(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user