mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-13 19:29:54 +00:00
feat(infisical-pg): auth injection completed and validation in password router
This commit is contained in:
@@ -41,7 +41,7 @@ const AddTagPopoverContent = ({
|
||||
<div className="flex flex-col space-y-1.5">
|
||||
{wsTags?.map((wsTag: WsTag) => (
|
||||
<div
|
||||
key={`tag-${wsTag._id}`}
|
||||
key={`tag-${wsTag.id}`}
|
||||
className="mt-4 h-[32px] relative flex items-center justify-start hover:border-mineshaft-600 hover:border hover:bg-mineshaft-700 p-2 rounded-md hover:text-bunker-200 bg-none"
|
||||
onClick={() => handleSelectTag(wsTag)}
|
||||
onMouseEnter={() => handleTagOnMouseEnter(wsTag)}
|
||||
|
||||
@@ -64,7 +64,7 @@ const UpgradePlanModal = ({
|
||||
<button
|
||||
type='button'
|
||||
className='inline-flex justify-center rounded-md border border-transparent bg-primary opacity-80 hover:opacity-100 px-4 py-2 text-sm font-medium text-black hover:text-semibold duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2'
|
||||
onClick={() => router.push(`/org/${currentOrg?._id}/billing`)}
|
||||
onClick={() => router.push(`/org/${currentOrg?.id}/billing`)}
|
||||
>
|
||||
Upgrade Now
|
||||
</button>
|
||||
|
||||
@@ -41,7 +41,7 @@ type EnvironmentProps = {
|
||||
const ProjectUsersTable = ({ userData, changeData, myUser, filter, isUserListLoading }: Props) => {
|
||||
const { currentWorkspace } = useWorkspace();
|
||||
const { subscription } = useSubscription();
|
||||
const { data: wsKey } = useGetUserWsKey(currentWorkspace?._id ?? "");
|
||||
const { data: wsKey } = useGetUserWsKey(currentWorkspace?.id ?? "");
|
||||
|
||||
const { mutateAsync: deleteUserFromWorkspaceMutateAsync } = useDeleteUserFromWorkspace();
|
||||
const { mutateAsync: uploadWsKeyMutateAsync } = useUploadWsKey();
|
||||
|
||||
@@ -37,7 +37,7 @@ const AddTagsMenu = ({ allTags, currentTags, modifyTags, id }: { allTags: Tag[];
|
||||
>
|
||||
<Menu.Items className="absolute z-[90] text-sm drop-shadow-xl right-0 mt-0.5 w-[12rem] origin-top-right rounded-md bg-mineshaft-600 border border-mineshaft-500 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none p-1 space-y-1">
|
||||
{allTags?.map((tag) => { return (
|
||||
<Menu.Item key={tag._id}>
|
||||
<Menu.Item key={tag.id}>
|
||||
<button
|
||||
type="button"
|
||||
className={`${currentTags?.map(currentTag => currentTag.name).includes(tag.name) ? "opacity-30 cursor-default" : "hover:bg-mineshaft-700"} w-full text-left bg-mineshaft-800 px-2 py-0.5 text-bunker-200 rounded-sm flex items-center`}
|
||||
|
||||
@@ -147,9 +147,9 @@ const KeyPair = ({
|
||||
<div className="w-2/12 h-10 flex items-center overflow-visible overflow-r-scroll no-scrollbar no-scrollbar::-webkit-scrollbar">
|
||||
<div className="flex items-center max-h-16">
|
||||
{keyPair.tags?.map((tag, index) => (
|
||||
index < 2 && <div key={keyPair.pos} className={`ml-2 px-1.5 ${tagData.filter(tagDp => tagDp._id === tag._id)[0]?.color} rounded-sm text-sm ${tagData.filter(tagDp => tagDp._id === tag._id)[0]?.colorText} flex items-center`}>
|
||||
index < 2 && <div key={keyPair.pos} className={`ml-2 px-1.5 ${tagData.filter(tagDp => tagDp.id === tag.id)[0]?.color} rounded-sm text-sm ${tagData.filter(tagDp => tagDp.id === tag.id)[0]?.colorText} flex items-center`}>
|
||||
<span className='mb-0.5 cursor-default'>{tag.name}</span>
|
||||
<FontAwesomeIcon icon={faXmark} className="ml-1 cursor-pointer p-1" onClick={() => modifyTags(keyPair.tags.filter(ttag => ttag._id !== tag._id), keyPair.id)}/>
|
||||
<FontAwesomeIcon icon={faXmark} className="ml-1 cursor-pointer p-1" onClick={() => modifyTags(keyPair.tags.filter(ttag => ttag.id !== tag.id), keyPair.id)}/>
|
||||
</div>
|
||||
))}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ export default function NavHeader({
|
||||
<div className="mr-2 flex h-5 w-5 items-center justify-center rounded-md bg-primary text-sm text-black">
|
||||
{currentOrg?.name?.charAt(0)}
|
||||
</div>
|
||||
<Link passHref legacyBehavior href={`/org/${currentOrg?._id}/overview`}>
|
||||
<Link passHref legacyBehavior href={`/org/${currentOrg?.id}/overview`}>
|
||||
<a className="pl-0.5 text-sm font-semibold text-primary/80 hover:text-primary">
|
||||
{currentOrg?.name}
|
||||
</a>
|
||||
|
||||
@@ -191,14 +191,14 @@ export default function UserInfoStep({
|
||||
|
||||
const userOrgs = await fetchOrganizations();
|
||||
|
||||
const orgId = userOrgs[0]?._id;
|
||||
const orgId = userOrgs[0]?.id;
|
||||
const project = await ProjectService.initProject({
|
||||
organizationId: orgId,
|
||||
projectName: "Example Project"
|
||||
});
|
||||
|
||||
localStorage.setItem("orgData.id", orgId);
|
||||
localStorage.setItem("projectData.id", project._id);
|
||||
localStorage.setItem("projectData.id", project.id);
|
||||
|
||||
incrementStep();
|
||||
} catch (error) {
|
||||
|
||||
@@ -112,7 +112,7 @@ export const CreateTagModal = ({ isOpen, onToggle }: Props): JSX.Element => {
|
||||
});
|
||||
const { createNotification } = useNotificationContext();
|
||||
const { currentWorkspace } = useWorkspace();
|
||||
const workspaceId = currentWorkspace?._id || "";
|
||||
const workspaceId = currentWorkspace?.id || "";
|
||||
|
||||
const { mutateAsync: createWsTag } = useCreateWsTag();
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ const ENV = process.env.NEXT_PUBLIC_ENV! || "development"; // investigate
|
||||
const POSTHOG_API_KEY = process.env.NEXT_PUBLIC_POSTHOG_API_KEY!;
|
||||
const POSTHOG_HOST =
|
||||
process.env.NEXT_PUBLIC_POSTHOG_HOST! || "https://app.posthog.com";
|
||||
const INTERCOM_ID = process.env.NEXT_PUBLIC_INTERCOM_ID!;
|
||||
const INTERCOMid = process.env.NEXT_PUBLIC_INTERCOMid!;
|
||||
|
||||
export {
|
||||
ENV,
|
||||
INTERCOM_ID,
|
||||
INTERCOMid,
|
||||
POSTHOG_API_KEY,
|
||||
POSTHOG_HOST
|
||||
};
|
||||
@@ -9,7 +9,7 @@
|
||||
/* eslint-disable func-names */
|
||||
// @ts-nocheck
|
||||
|
||||
import { INTERCOM_ID as APP_ID } from "@app/components/utilities/config";
|
||||
import { INTERCOMid as APPid } from "@app/components/utilities/config";
|
||||
|
||||
// Loads Intercom with the snippet
|
||||
// This must be run before boot, it initializes window.Intercom
|
||||
@@ -37,7 +37,7 @@ export const load = () => {
|
||||
var s=d.createElement("script");
|
||||
s.type="text/javascript";
|
||||
s.async=true;
|
||||
s.src="https://widget.intercom.io/widget/" + APP_ID;
|
||||
s.src="https://widget.intercom.io/widget/" + APPid;
|
||||
var x=d.getElementsByTagName("script")[0];
|
||||
x.parentNode.insertBefore(s, x);
|
||||
};
|
||||
@@ -56,7 +56,7 @@ export const load = () => {
|
||||
export const boot = (options = {}) => {
|
||||
window &&
|
||||
window.Intercom &&
|
||||
window.Intercom("boot", { app_id: APP_ID, ...options });
|
||||
window.Intercom("boot", { appid: APPid, ...options });
|
||||
};
|
||||
|
||||
export const update = () => {
|
||||
|
||||
@@ -16,7 +16,7 @@ export const UpgradePlanModal = ({ text, isOpen, onOpenChange }: Props): JSX.Ele
|
||||
const { mutateAsync, isLoading } = useGetOrgTrialUrl();
|
||||
const link =
|
||||
subscription && subscription.slug !== null
|
||||
? `/org/${currentOrg?._id}/billing`
|
||||
? `/org/${currentOrg?.id}/billing`
|
||||
: "https://infisical.com/scheduledemo";
|
||||
|
||||
const handleUpgradeBtnClick = async () => {
|
||||
@@ -27,7 +27,7 @@ export const UpgradePlanModal = ({ text, isOpen, onOpenChange }: Props): JSX.Ele
|
||||
// direct user to start pro trial
|
||||
|
||||
const url = await mutateAsync({
|
||||
orgId: currentOrg._id,
|
||||
orgId: currentOrg.id,
|
||||
success_url: window.location.href
|
||||
});
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ const OrgPermissionContext = createContext<null | {
|
||||
|
||||
export const OrgPermissionProvider = ({ children }: Props): JSX.Element => {
|
||||
const { currentOrg } = useOrganization();
|
||||
const orgId = currentOrg?._id || "";
|
||||
const orgId = currentOrg?.id || "";
|
||||
const { data: permission, isLoading } = useGetUserOrgPermissions({ orgId });
|
||||
|
||||
if (isLoading) {
|
||||
|
||||
@@ -26,7 +26,7 @@ export const OrgProvider = ({ children }: Props): JSX.Element => {
|
||||
const value = useMemo<TOrgContext>(
|
||||
() => ({
|
||||
orgs: userOrgs,
|
||||
currentOrg: (userOrgs || []).find(({ _id }) => _id === currentWsOrgID) || (userOrgs || [])[0],
|
||||
currentOrg: (userOrgs || []).find(({ id }) => id === currentWsOrgID) || (userOrgs || [])[0],
|
||||
isLoading
|
||||
}),
|
||||
[currentWsOrgID, userOrgs, isLoading]
|
||||
|
||||
@@ -13,7 +13,7 @@ const ProjectPermissionContext = createContext<null | TProjectPermission>(null);
|
||||
|
||||
export const ProjectPermissionProvider = ({ children }: Props): JSX.Element => {
|
||||
const { currentWorkspace, isLoading: isWsLoading } = useWorkspace();
|
||||
const workspaceId = currentWorkspace?._id || "";
|
||||
const workspaceId = currentWorkspace?.id || "";
|
||||
const { data: permission, isLoading } = useGetUserProjectPermissions({ workspaceId });
|
||||
|
||||
if ((isLoading && currentWorkspace) || isWsLoading) {
|
||||
|
||||
@@ -20,7 +20,7 @@ export const SubscriptionProvider = ({ children }: Props): JSX.Element => {
|
||||
const { currentOrg } = useOrganization();
|
||||
|
||||
const { data, isLoading } = useGetOrgSubscription({
|
||||
orgID: currentOrg?._id || ""
|
||||
orgID: currentOrg?.id || ""
|
||||
});
|
||||
|
||||
// memorize the workspace details for the context
|
||||
|
||||
@@ -26,7 +26,7 @@ export const WorkspaceProvider = ({ children }: Props): JSX.Element => {
|
||||
const wsId = workspaceId || localStorage.getItem("projectData.id");
|
||||
return {
|
||||
workspaces: ws || [],
|
||||
currentWorkspace: (ws || []).find(({ _id: id }) => id === wsId),
|
||||
currentWorkspace: (ws || []).find(({ id: id }) => id === wsId),
|
||||
isLoading
|
||||
};
|
||||
}, [ws, workspaceId, isLoading]);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export type APIKeyDataV2 = {
|
||||
_id: string;
|
||||
id: string;
|
||||
name: string;
|
||||
user: string;
|
||||
lastUsed?: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export type TBot = {
|
||||
_id: string;
|
||||
id: string;
|
||||
name: string;
|
||||
workspace: string;
|
||||
isActive: boolean;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export type IncidentContact = {
|
||||
_id: string;
|
||||
id: string;
|
||||
email: string;
|
||||
organization: string;
|
||||
__v: number;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export type IntegrationAuth = {
|
||||
_id: string;
|
||||
id: string;
|
||||
integration: string;
|
||||
workspace: string;
|
||||
__v: number;
|
||||
|
||||
@@ -10,7 +10,7 @@ export type TCloudIntegration = {
|
||||
};
|
||||
|
||||
export type TIntegration = {
|
||||
_id: string;
|
||||
id: string;
|
||||
workspace: string;
|
||||
environment: string;
|
||||
isActive: boolean;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export type UserWsKeyPair = {
|
||||
_id: string;
|
||||
id: string;
|
||||
encryptedKey: string;
|
||||
nonce: string;
|
||||
sender: Sender;
|
||||
@@ -11,7 +11,7 @@ export type UserWsKeyPair = {
|
||||
};
|
||||
|
||||
export type Sender = {
|
||||
_id: string;
|
||||
id: string;
|
||||
email: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export type Organization = {
|
||||
_id: string;
|
||||
id: string;
|
||||
name: string;
|
||||
createAt: string;
|
||||
updatedAt: string;
|
||||
@@ -25,7 +25,7 @@ export type PlanBillingInfo = {
|
||||
}
|
||||
|
||||
export type Invoice = {
|
||||
_id: string;
|
||||
id: string;
|
||||
created: number;
|
||||
invoice_pdf: string;
|
||||
number: string;
|
||||
@@ -34,7 +34,7 @@ export type Invoice = {
|
||||
}
|
||||
|
||||
export type PmtMethod = {
|
||||
_id: string;
|
||||
id: string;
|
||||
brand: string;
|
||||
exp_month: number;
|
||||
exp_year: number;
|
||||
@@ -43,14 +43,14 @@ export type PmtMethod = {
|
||||
}
|
||||
|
||||
export type TaxID = {
|
||||
_id: string;
|
||||
id: string;
|
||||
country: string;
|
||||
type: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export type License = {
|
||||
_id: string;
|
||||
id: string;
|
||||
customerId: string;
|
||||
prefix: string;
|
||||
licenseKey: string;
|
||||
|
||||
@@ -4,7 +4,7 @@ export type TGetRolesDTO = {
|
||||
};
|
||||
|
||||
export type TRole<T extends string | undefined> = {
|
||||
_id: string;
|
||||
id: string;
|
||||
organization: string;
|
||||
workspace: T;
|
||||
name: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export type TSecretApprovalPolicy = {
|
||||
_id: string;
|
||||
id: string;
|
||||
workspace: string;
|
||||
name: string;
|
||||
environment: string;
|
||||
|
||||
@@ -78,7 +78,7 @@ export const decryptSecretApprovalSecret = (
|
||||
key
|
||||
});
|
||||
return {
|
||||
_id: encSecret._id,
|
||||
id: encSecret.id,
|
||||
version: encSecret.version,
|
||||
secretKey,
|
||||
secretValue,
|
||||
|
||||
@@ -16,7 +16,7 @@ export enum CommitType {
|
||||
}
|
||||
|
||||
export type TSecretApprovalSecChangeData = {
|
||||
_id: string;
|
||||
id: string;
|
||||
secretKeyCiphertext: string;
|
||||
secretKeyIV: string;
|
||||
secretKeyTag: string;
|
||||
@@ -34,7 +34,7 @@ export type TSecretApprovalSecChangeData = {
|
||||
};
|
||||
|
||||
export type TSecretApprovalSecChange = {
|
||||
_id: string;
|
||||
id: string;
|
||||
version: number;
|
||||
secretKey: string;
|
||||
secretValue: string;
|
||||
@@ -46,7 +46,7 @@ export type TSecretApprovalRequest<
|
||||
T extends unknown = TSecretApprovalSecChangeData,
|
||||
J extends unknown = EncryptedSecret
|
||||
> = {
|
||||
_id: string;
|
||||
id: string;
|
||||
slug: string;
|
||||
createdAt: string;
|
||||
committer: string;
|
||||
|
||||
@@ -142,7 +142,7 @@ export const useGetImportedSecrets = ({
|
||||
});
|
||||
|
||||
return {
|
||||
_id: encSecret._id,
|
||||
id: encSecret.id,
|
||||
env: encSecret.environment,
|
||||
key: secretKey,
|
||||
value: secretValue,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { UserWsKeyPair } from "../keys/types";
|
||||
import { EncryptedSecret } from "../secrets/types";
|
||||
|
||||
export type TSecretImports = {
|
||||
_id: string;
|
||||
id: string;
|
||||
workspaceId: string;
|
||||
environment: string;
|
||||
folderId: string;
|
||||
|
||||
@@ -71,7 +71,7 @@ export type TProviderTemplate = {
|
||||
};
|
||||
|
||||
export type TSecretRotation<T extends unknown = EncryptedSecret> = {
|
||||
_id: string;
|
||||
id: string;
|
||||
interval: number;
|
||||
provider: string;
|
||||
customProvider: string;
|
||||
|
||||
@@ -102,7 +102,7 @@ export const useGetSnapshotSecrets = ({ decryptFileKey, env, snapshotId }: TSnap
|
||||
const secretComment = "";
|
||||
|
||||
const decryptedSecret = {
|
||||
_id: encSecret.secret,
|
||||
id: encSecret.secret,
|
||||
env: encSecret.environment,
|
||||
key: secretKey,
|
||||
value: secretValue,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { UserWsKeyPair } from "../keys/types";
|
||||
import { EncryptedSecretVersion } from "../secrets/types";
|
||||
|
||||
export type TSecretSnapshot = {
|
||||
_id: string;
|
||||
id: string;
|
||||
workspace: string;
|
||||
version: number;
|
||||
secretVersions: string[];
|
||||
|
||||
@@ -63,7 +63,7 @@ export const decryptSecrets = (
|
||||
});
|
||||
|
||||
const decryptedSecret: DecryptedSecret = {
|
||||
_id: encSecret._id,
|
||||
id: encSecret.id,
|
||||
env: encSecret.environment,
|
||||
key: secretKey,
|
||||
value: secretValue,
|
||||
@@ -79,7 +79,7 @@ export const decryptSecrets = (
|
||||
|
||||
if (encSecret.type === "personal") {
|
||||
personalSecrets[decryptedSecret.key] = {
|
||||
id: encSecret._id,
|
||||
id: encSecret.id,
|
||||
value: secretValue
|
||||
};
|
||||
} else {
|
||||
@@ -225,7 +225,7 @@ export const useGetSecretVersion = (dto: GetSecretVersionsDTO) =>
|
||||
return data
|
||||
.map((el) => ({
|
||||
createdAt: el.createdAt,
|
||||
id: el._id,
|
||||
id: el.id,
|
||||
value: decryptSymmetric({
|
||||
ciphertext: el.secretValueCiphertext,
|
||||
iv: el.secretValueIV,
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { UserWsKeyPair } from "../keys/types";
|
||||
import type { WsTag } from "../tags/types";
|
||||
|
||||
export type EncryptedSecret = {
|
||||
_id: string;
|
||||
id: string;
|
||||
version: number;
|
||||
workspace: string;
|
||||
type: "shared" | "personal";
|
||||
@@ -26,7 +26,7 @@ export type EncryptedSecret = {
|
||||
};
|
||||
|
||||
export type DecryptedSecret = {
|
||||
_id: string;
|
||||
id: string;
|
||||
version: number;
|
||||
key: string;
|
||||
value: string;
|
||||
@@ -45,7 +45,7 @@ export type DecryptedSecret = {
|
||||
};
|
||||
|
||||
export type EncryptedSecretVersion = {
|
||||
_id: string;
|
||||
id: string;
|
||||
secret: string;
|
||||
version: number;
|
||||
workspace: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export type SubscriptionPlan = {
|
||||
_id: string;
|
||||
id: string;
|
||||
membersUsed: number;
|
||||
memberLimit: number;
|
||||
auditLogs: boolean;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export type UserWsTags = WsTag[];
|
||||
|
||||
export type WsTag = {
|
||||
_id: string;
|
||||
id: string;
|
||||
name: string;
|
||||
slug: string;
|
||||
tagColor?: string;
|
||||
@@ -11,7 +11,7 @@ export type WsTag = {
|
||||
__v: number;
|
||||
}
|
||||
|
||||
export type WorkspaceTag = { _id: string; name: string; slug: string };
|
||||
export type WorkspaceTag = { id: string; name: string; slug: string };
|
||||
|
||||
export type CreateTagDTO = {
|
||||
workspaceID: string;
|
||||
@@ -27,7 +27,7 @@ export type CreateTagRes = {
|
||||
createdAt: string;
|
||||
tagColor?: string;
|
||||
user: string;
|
||||
_id: string;
|
||||
id: string;
|
||||
};
|
||||
|
||||
export type DeleteTagDTO = { tagID: string; };
|
||||
@@ -38,12 +38,12 @@ export type DeleteWsTagRes = {
|
||||
workspace: string;
|
||||
createdAt: string;
|
||||
user: string;
|
||||
_id: string;
|
||||
id: string;
|
||||
};
|
||||
|
||||
export type SecretTags = {
|
||||
id: string;
|
||||
_id: string;
|
||||
id: string;
|
||||
slug: string;
|
||||
tagColor: string;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export type TrustedIp = {
|
||||
_id: string;
|
||||
id: string;
|
||||
workspace: string;
|
||||
ipAddress: string;
|
||||
type: "ipv4" | "ipv6";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export type TWebhook = {
|
||||
_id: string;
|
||||
id: string;
|
||||
workspace: string;
|
||||
environment: string;
|
||||
secretPath: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export type Workspace = {
|
||||
__v: number;
|
||||
_id: string;
|
||||
id: string;
|
||||
name: string;
|
||||
organization: string;
|
||||
autoCapitalization: boolean;
|
||||
@@ -14,13 +14,13 @@ export type WorkspaceEnv = {
|
||||
isWriteDenied: boolean;
|
||||
};
|
||||
|
||||
export type WorkspaceTag = { _id: string; name: string; slug: string };
|
||||
export type WorkspaceTag = { id: string; name: string; slug: string };
|
||||
|
||||
export type NameWorkspaceSecretsDTO = {
|
||||
workspaceId: string;
|
||||
secretsToUpdate: {
|
||||
secretName: string;
|
||||
_id: string;
|
||||
id: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ export const AdminLayout = ({ children }: LayoutProps) => {
|
||||
<div>
|
||||
{!router.asPath.includes("personal") && (
|
||||
<div className="flex h-12 cursor-default justify-between items-center px-3 pt-6">
|
||||
<Link href={`/org/${currentOrg?._id}/overview`}>
|
||||
<Link href={`/org/${currentOrg?.id}/overview`}>
|
||||
<div className="my-6 flex cursor-default items-center justify-center pr-2 text-sm text-mineshaft-300 hover:text-mineshaft-100">
|
||||
<FontAwesomeIcon icon={faArrowLeft} className="pr-3" />
|
||||
Back to organization
|
||||
@@ -264,7 +264,7 @@ export const AdminLayout = ({ children }: LayoutProps) => {
|
||||
|
||||
// direct user to start pro trial
|
||||
const url = await mutateAsync({
|
||||
orgId: currentOrg._id,
|
||||
orgId: currentOrg.id,
|
||||
success_url: window.location.href
|
||||
});
|
||||
|
||||
|
||||
@@ -267,15 +267,15 @@ export const Navbar = () => {
|
||||
</div>
|
||||
<div className="mt-3 mb-2 flex flex-col items-start px-1">
|
||||
{orgs
|
||||
?.filter((org: { _id: string }) => org._id !== currentOrg?._id)
|
||||
.map((org: { _id: string; name: string }) => (
|
||||
?.filter((org: { id: string }) => org.id !== currentOrg?.id)
|
||||
.map((org: { id: string; name: string }) => (
|
||||
<div
|
||||
onKeyDown={() => null}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
key={guidGenerator()}
|
||||
onClick={() => {
|
||||
localStorage.setItem("orgData.id", org._id);
|
||||
localStorage.setItem("orgData.id", org.id);
|
||||
router.reload();
|
||||
}}
|
||||
className="flex w-full cursor-pointer flex-row items-center justify-start rounded-md p-1.5 hover:bg-white/5"
|
||||
@@ -326,7 +326,7 @@ export const Navbar = () => {
|
||||
|
||||
// direct user to start pro trial
|
||||
const url = await mutateAsync({
|
||||
orgId: currentOrg._id,
|
||||
orgId: currentOrg.id,
|
||||
success_url: window.location.href
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import SecurityClient from "@app/components/utilities/SecurityClient";
|
||||
|
||||
export type IGitRisks = {
|
||||
_id: string;
|
||||
id: string;
|
||||
description: string;
|
||||
startLine: string;
|
||||
endLine: string;
|
||||
|
||||
@@ -18,7 +18,7 @@ export default function DashboardRedirect() {
|
||||
if (localStorage.getItem("orgData.id")) {
|
||||
router.push(`/org/${localStorage.getItem("orgData.id")}/overview`);
|
||||
} else if (userOrgs) {
|
||||
userOrg = userOrgs[0]._id;
|
||||
userOrg = userOrgs[0].id;
|
||||
router.push(`/org/${userOrg}/overview`);
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -52,7 +52,7 @@ export default function AWSParameterStoreAuthorizeIntegrationPage() {
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(
|
||||
`/integrations/aws-parameter-store/create?integrationAuthId=${integrationAuth._id}`
|
||||
`/integrations/aws-parameter-store/create?integrationAuthId=${integrationAuth.id}`
|
||||
);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
|
||||
@@ -95,12 +95,12 @@ export default function AWSParameterStoreCreateIntegrationPage() {
|
||||
}
|
||||
}
|
||||
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
sourceEnvironment: selectedSourceEnvironment,
|
||||
path,
|
||||
|
||||
@@ -50,7 +50,7 @@ export default function AWSSecretManagerCreateIntegrationPage() {
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(
|
||||
`/integrations/aws-secret-manager/create?integrationAuthId=${integrationAuth._id}`
|
||||
`/integrations/aws-secret-manager/create?integrationAuthId=${integrationAuth.id}`
|
||||
);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
|
||||
@@ -94,12 +94,12 @@ export default function AWSSecretManagerCreateIntegrationPage() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetSecretName.trim(),
|
||||
sourceEnvironment: selectedSourceEnvironment,
|
||||
|
||||
@@ -53,11 +53,11 @@ export default function AzureKeyVaultCreateIntegrationPage() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: vaultBaseUrl,
|
||||
sourceEnvironment: selectedSourceEnvironment,
|
||||
|
||||
@@ -26,7 +26,7 @@ export default function AzureKeyVaultOAuth2CallbackPage() {
|
||||
});
|
||||
|
||||
router.push(
|
||||
`/integrations/azure-key-vault/create?integrationAuthId=${integrationAuth._id}`
|
||||
`/integrations/azure-key-vault/create?integrationAuthId=${integrationAuth.id}`
|
||||
);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
|
||||
@@ -72,7 +72,7 @@ export default function BitBucketCreateIntegrationPage() {
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
const targetApp = integrationAuthApps?.find(
|
||||
(integrationAuthApp) => integrationAuthApp.appId === targetAppId
|
||||
@@ -84,7 +84,7 @@ export default function BitBucketCreateIntegrationPage() {
|
||||
if (!targetApp || !targetApp.appId || !targetEnvironment) return;
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp.name,
|
||||
appId: targetApp.appId,
|
||||
|
||||
@@ -24,7 +24,7 @@ export default function BitBucketOAuth2CallbackPage() {
|
||||
integration: "bitbucket"
|
||||
});
|
||||
|
||||
router.push(`/integrations/bitbucket/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/bitbucket/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function ChecklyCreateIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/checkly/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/checkly/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ export default function ChecklyCreateIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
@@ -94,7 +94,7 @@ export default function ChecklyCreateIntegrationPage() {
|
||||
if (!targetApp) return;
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp?.name,
|
||||
appId: targetApp?.appId,
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function CircleCICreateIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/circleci/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/circleci/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -63,12 +63,12 @@ export default function CircleCICreateIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp,
|
||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function Cloud66CreateIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/cloud-66/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/cloud-66/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -56,12 +56,12 @@ export default function Cloud66CreateIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp,
|
||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||
|
||||
@@ -40,7 +40,7 @@ export default function CloudflarePagesIntegrationPage() {
|
||||
setAccountId("");
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/cloudflare-pages/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/cloudflare-pages/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -53,12 +53,12 @@ export default function CloudflarePagesIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp,
|
||||
appId: targetAppId,
|
||||
|
||||
@@ -40,7 +40,7 @@ export default function CloudflareWorkersIntegrationPage() {
|
||||
setAccountId("");
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/cloudflare-workers/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/cloudflare-workers/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -45,12 +45,12 @@ export default function CloudflareWorkersIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp,
|
||||
appId: targetAppId,
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function CodefreshCreateIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/codefresh/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/codefresh/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -56,12 +56,12 @@ export default function CodefreshCreateIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp,
|
||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function DigitalOceanAppPlatformCreateIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/digital-ocean-app-platform/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/digital-ocean-app-platform/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -56,12 +56,12 @@ export default function DigitalOceanAppPlatformCreateIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp,
|
||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||
|
||||
@@ -51,7 +51,7 @@ export default function FlyioAuthorizeIntegrationPage() {
|
||||
});
|
||||
|
||||
setIsLoading(false);
|
||||
router.push(`/integrations/flyio/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/flyio/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
setIsLoading(false);
|
||||
console.error(err);
|
||||
|
||||
@@ -65,12 +65,12 @@ export default function FlyioCreateIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp,
|
||||
sourceEnvironment: selectedSourceEnvironment,
|
||||
|
||||
@@ -49,7 +49,7 @@ export default function GCPSecretManagerAuthorizeIntegrationPage() {
|
||||
const state = crypto.randomBytes(16).toString("hex");
|
||||
localStorage.setItem("latestCSRFToken", state);
|
||||
|
||||
const link = `https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/cloud-platform&response_type=code&access_type=offline&state=${state}&redirect_uri=${window.location.origin}/integrations/gcp-secret-manager/oauth2/callback&client_id=${integrationOption.clientId}`;
|
||||
const link = `https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/cloud-platform&response_type=code&access_type=offline&state=${state}&redirect_uri=${window.location.origin}/integrations/gcp-secret-manager/oauth2/callback&clientid=${integrationOption.clientId}`;
|
||||
window.location.assign(link);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ export default function GCPSecretManagerAuthorizeIntegrationPage() {
|
||||
});
|
||||
|
||||
setIsLoading(false);
|
||||
router.push(`/integrations/gcp-secret-manager/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/gcp-secret-manager/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
setIsLoading(false);
|
||||
|
||||
@@ -133,10 +133,10 @@ export default function GCPSecretManagerCreateIntegrationPage() {
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.appId === targetAppId)?.name,
|
||||
appId: targetAppId,
|
||||
|
||||
@@ -25,7 +25,7 @@ export default function GCPSecretManagerOAuth2CallbackPage() {
|
||||
integration: "gcp-secret-manager"
|
||||
});
|
||||
|
||||
router.push(`/integrations/gcp-secret-manager/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/gcp-secret-manager/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ export default function GitHubCreateIntegrationPage() {
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
const targetApps = integrationAuthApps?.filter(
|
||||
(integrationAuthApp) => targetAppIds.includes(String(integrationAuthApp.appId))
|
||||
@@ -90,7 +90,7 @@ export default function GitHubCreateIntegrationPage() {
|
||||
await Promise.all(
|
||||
targetApps.map(async (targetApp) => {
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp.name,
|
||||
sourceEnvironment: selectedSourceEnvironment,
|
||||
|
||||
@@ -25,7 +25,7 @@ export default function GitHubOAuth2CallbackPage() {
|
||||
integration: "github"
|
||||
});
|
||||
|
||||
router.push(`/integrations/github/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/github/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export default function GitLabAuthorizeIntegrationPage() {
|
||||
localStorage.setItem("latestCSRFToken", csrfToken);
|
||||
|
||||
const state = `${csrfToken}|${(gitLabURL as string).trim() === "" ? "" : (gitLabURL as string).trim()}`;
|
||||
const link = `${baseURL}/oauth/authorize?client_id=${integrationOption.clientId}&redirect_uri=${window.location.origin}/integrations/gitlab/oauth2/callback&response_type=code&state=${state}`;
|
||||
const link = `${baseURL}/oauth/authorize?clientid=${integrationOption.clientId}&redirect_uri=${window.location.origin}/integrations/gitlab/oauth2/callback&response_type=code&state=${state}`;
|
||||
|
||||
window.location.assign(link);
|
||||
}
|
||||
|
||||
@@ -146,10 +146,10 @@ export default function GitLabCreateIntegrationPage() {
|
||||
}: FormData) => {
|
||||
try {
|
||||
setIsLoading(true);
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: integrationAuthApps?.find((integrationAuthApp) => String(integrationAuthApp.appId) === targetAppId)?.name,
|
||||
appId: String(targetAppId),
|
||||
|
||||
@@ -29,7 +29,7 @@ export default function GitLabOAuth2CallbackPage() {
|
||||
})
|
||||
});
|
||||
|
||||
router.push(`/integrations/gitlab/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/gitlab/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ export default function HashiCorpVaultAuthorizeIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/hashicorp-vault/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/hashicorp-vault/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export default function HashiCorpVaultCreateIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
if (!isValidVaultPath(vaultEnginePath)) {
|
||||
setVaultEnginePathErrorText("Vault KV Secrets Engine Path must be valid like kv");
|
||||
@@ -67,7 +67,7 @@ export default function HashiCorpVaultCreateIntegrationPage() {
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: vaultEnginePath,
|
||||
sourceEnvironment: selectedSourceEnvironment,
|
||||
|
||||
@@ -42,7 +42,7 @@ export default function HasuraCloudAuthorizeIntegrationPage() {
|
||||
});
|
||||
|
||||
setIsLoading(false);
|
||||
router.push(`/integrations/hasura-cloud/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/hasura-cloud/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
setIsLoading(false);
|
||||
console.error(err);
|
||||
|
||||
@@ -58,11 +58,11 @@ export default function HasuraCloudCreateIntegrationPage() {
|
||||
|
||||
const onFormSubmit = async ({ secretPath, sourceEnvironment, appId }: FormData) => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
const app = integrationAuthApps?.find((data) => data.appId === appId);
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
sourceEnvironment,
|
||||
secretPath,
|
||||
|
||||
@@ -59,10 +59,10 @@ export default function HerokuCreateIntegrationPage() {
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp,
|
||||
sourceEnvironment: selectedSourceEnvironment,
|
||||
|
||||
@@ -24,7 +24,7 @@ export default function HerokuOAuth2CallbackPage() {
|
||||
integration: "heroku"
|
||||
});
|
||||
|
||||
router.push(`/integrations/heroku/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/heroku/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export default function LaravelForgeCreateIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/laravel-forge/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/laravel-forge/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -56,12 +56,12 @@ export default function LaravelForgeCreateIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp,
|
||||
appId: String(integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId),
|
||||
|
||||
@@ -67,10 +67,10 @@ export default function NetlifyCreateIntegrationPage() {
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp,
|
||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||
|
||||
@@ -25,7 +25,7 @@ export default function NetlifyOAuth2CallbackPage() {
|
||||
integration: "netlify"
|
||||
});
|
||||
|
||||
router.push(`/integrations/netlify/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/netlify/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function NorthflankCreateIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/northflank/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/northflank/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -78,12 +78,12 @@ export default function NorthflankCreateIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.appId === targetAppId)?.name,
|
||||
appId: targetAppId,
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function QoveryCreateIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/qovery/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/qovery/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ export default function QoveryCreateIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
@@ -151,7 +151,7 @@ export default function QoveryCreateIntegrationPage() {
|
||||
const targetApp = integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.appId === targetAppId)?.name;
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp,
|
||||
appId: targetAppId,
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function RailwayAuthorizeIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/railway/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/railway/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ export default function RailwayCreateIntegrationPage() {
|
||||
try {
|
||||
setIsLoading(true);
|
||||
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
const targetApp = integrationAuthApps?.find(
|
||||
(integrationAuthApp) => integrationAuthApp.appId === targetAppId
|
||||
@@ -106,7 +106,7 @@ export default function RailwayCreateIntegrationPage() {
|
||||
);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp.name,
|
||||
appId: targetApp.appId,
|
||||
|
||||
@@ -36,7 +36,7 @@ export default function RenderCreateIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/render/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/render/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -61,12 +61,12 @@ export default function RenderCreateIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp,
|
||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function SupabaseCreateIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/supabase/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/supabase/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -57,12 +57,12 @@ export default function SupabaseCreateIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp,
|
||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||
|
||||
@@ -48,7 +48,7 @@ export default function TeamCityCreateIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/teamcity/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/teamcity/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ export default function TeamCityCreateIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setIsLoading(true);
|
||||
|
||||
@@ -77,7 +77,7 @@ export default function TeamCityCreateIntegrationPage() {
|
||||
);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.appId === targetAppId)?.name,
|
||||
appId: targetAppId,
|
||||
|
||||
@@ -43,7 +43,7 @@ export default function TerraformCloudCreateIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/terraform-cloud/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/terraform-cloud/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ export default function TerraformCloudCreateIntegrationPage() {
|
||||
|
||||
const handleButtonClick = async () => {
|
||||
try {
|
||||
if (!integrationAuth?._id) return;
|
||||
if (!integrationAuth?.id) return;
|
||||
|
||||
setVariableTypeErrorText("");
|
||||
if (variableType.length === 0 ) {
|
||||
@@ -73,7 +73,7 @@ export default function TerraformCloudCreateIntegrationPage() {
|
||||
setIsLoading(true);
|
||||
|
||||
await mutateAsync({
|
||||
integrationAuthId: integrationAuth?._id,
|
||||
integrationAuthId: integrationAuth?.id,
|
||||
isActive: true,
|
||||
app: targetApp,
|
||||
appId: integrationAuthApps?.find((integrationAuthApp) => integrationAuthApp.name === targetApp)?.appId,
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function TravisCICreateIntegrationPage() {
|
||||
|
||||
setIsLoading(false);
|
||||
|
||||
router.push(`/integrations/travisci/create?integrationAuthId=${integrationAuth._id}`);
|
||||
router.push(`/integrations/travisci/create?integrationAuthId=${integrationAuth.id}`);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user