diff --git a/backend/src/services/secret-sharing/secret-sharing-service.ts b/backend/src/services/secret-sharing/secret-sharing-service.ts index 48332f7b9..ea89d5036 100644 --- a/backend/src/services/secret-sharing/secret-sharing-service.ts +++ b/backend/src/services/secret-sharing/secret-sharing-service.ts @@ -80,6 +80,7 @@ export const secretSharingServiceFactory = ({ const getActiveSharedSecretByIdAndHashedHex = async (sharedSecretId: string, hashedHex: string) => { const sharedSecret = await secretSharingDAL.findOne({ id: sharedSecretId, hashedHex }); + if (!sharedSecret) return; if (sharedSecret.expiresAt && sharedSecret.expiresAt < new Date()) { return; } diff --git a/frontend/src/pages/share-secret/index.tsx b/frontend/src/pages/share-secret/index.tsx index 95007a4a9..53b034650 100644 --- a/frontend/src/pages/share-secret/index.tsx +++ b/frontend/src/pages/share-secret/index.tsx @@ -2,7 +2,7 @@ import Head from "next/head"; import { ShareSecretPublicPage } from "@app/views/ShareSecretPublicPage"; -const SecretApproval = () => { +const ShareNewPublicSecretPage = () => { return ( <> @@ -12,13 +12,13 @@ const SecretApproval = () => { -
- +
+
); }; -export default SecretApproval; +export default ShareNewPublicSecretPage; -SecretApproval.requireAuth = false; +ShareNewPublicSecretPage.requireAuth = false; diff --git a/frontend/src/pages/shared/secret/[id]/index.tsx b/frontend/src/pages/shared/secret/[id]/index.tsx index 95007a4a9..bda56347b 100644 --- a/frontend/src/pages/shared/secret/[id]/index.tsx +++ b/frontend/src/pages/shared/secret/[id]/index.tsx @@ -2,7 +2,7 @@ import Head from "next/head"; import { ShareSecretPublicPage } from "@app/views/ShareSecretPublicPage"; -const SecretApproval = () => { +const SecretSharedPublicPage = () => { return ( <> @@ -12,13 +12,13 @@ const SecretApproval = () => { -
- +
+
); }; -export default SecretApproval; +export default SecretSharedPublicPage; -SecretApproval.requireAuth = false; +SecretSharedPublicPage.requireAuth = false; diff --git a/frontend/src/views/ShareSecretPage/components/AddShareSecretForm.tsx b/frontend/src/views/ShareSecretPage/components/AddShareSecretForm.tsx index bec16fa53..ce1a2aa8e 100644 --- a/frontend/src/views/ShareSecretPage/components/AddShareSecretForm.tsx +++ b/frontend/src/views/ShareSecretPage/components/AddShareSecretForm.tsx @@ -125,11 +125,7 @@ export const AddShareSecretForm = ({ }; return (
-
+
-
+
diff --git a/frontend/src/views/ShareSecretPage/components/ViewAndCopySharedSecret.tsx b/frontend/src/views/ShareSecretPage/components/ViewAndCopySharedSecret.tsx index 5bb64ffd9..1efec0c36 100644 --- a/frontend/src/views/ShareSecretPage/components/ViewAndCopySharedSecret.tsx +++ b/frontend/src/views/ShareSecretPage/components/ViewAndCopySharedSecret.tsx @@ -15,24 +15,22 @@ export const ViewAndCopySharedSecret = ({ copyUrlToClipboard: () => void; }) => { return ( -
-
-

{newSharedSecret}

- - - - Click to Copy - - +
+
+
+

{newSharedSecret}

+ + + + Click to Copy + + +
); diff --git a/frontend/src/views/ShareSecretPublicPage/ShareSecretPublicPage.tsx b/frontend/src/views/ShareSecretPublicPage/ShareSecretPublicPage.tsx index 727e9cc09..12489f1e2 100644 --- a/frontend/src/views/ShareSecretPublicPage/ShareSecretPublicPage.tsx +++ b/frontend/src/views/ShareSecretPublicPage/ShareSecretPublicPage.tsx @@ -3,16 +3,18 @@ import Head from "next/head"; import Image from "next/image"; import Link from "next/link"; import { useRouter } from "next/router"; -import { faArrowRight } from "@fortawesome/free-solid-svg-icons"; +import { faArrowRight, faPlus } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { decryptSymmetric } from "@app/components/utilities/cryptography/crypto"; -import { useTimedReset } from "@app/hooks"; +import { Button } from "@app/components/v2"; +import { usePopUp, useTimedReset } from "@app/hooks"; import { useGetActiveSharedSecretByIdAndHashedHex } from "@app/hooks/api/secretSharing"; +import { AddShareSecretModal } from "../ShareSecretPage/components/AddShareSecretModal"; import { SecretTable } from "./components"; -export const ShareSecretPublicPage = () => { +export const ShareSecretPublicPage = ({ isNewSession }: { isNewSession: boolean }) => { const router = useRouter(); const { id, key: urlEncodedPublicKey } = router.query; const [hashedHex, key] = urlEncodedPublicKey @@ -52,7 +54,7 @@ export const ShareSecretPublicPage = () => { navigator.clipboard.writeText(decryptedSecret); setIsUrlCopied(true); }; - // const { popUp, handlePopUpToggle } = usePopUp(["createSharedSecret"] as const); + const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["createSharedSecret"] as const); return (
@@ -60,16 +62,22 @@ export const ShareSecretPublicPage = () => { Secret Shared | Infisical -
- -
- Infisical logo -
- -

+
+
+ + Infisical logo + +
+

{id ? "Someone shared a secret on Infisical with you." : "Share Secrets with Infisical"}

-
+
{id && ( { )}
-
-
+ {isNewSession && ( + + )} + +
+
-
-
+
+

Safe, Secure, & Open Source

- Infisical is the open source - secrets management platform for developers.
-

- Infisical Secret Sharing uses end-to-end encrypted architecture to ensure that - your secrets are truly private (even from us). + {" "} + secrets management platform for developers.
+
+ Infisical Secret Sharing uses end-to-end encrypted architecture to ensure that your + secrets are truly private (even from us).

- Learn More + + + Learn More + +
+ {!isNewSession && ( +
+ +
+ )}
- - {/*
-
- -
-
*/} -
+

© 2024{" "} Infisical - . All rights reserved. + + . All rights reserved.
156 2nd st, 3rd Floor, San Francisco, California, 94105, United States. 🇺🇸

+
); diff --git a/frontend/src/views/ShareSecretPublicPage/components/SecretTable.tsx b/frontend/src/views/ShareSecretPublicPage/components/SecretTable.tsx index 5701604e8..d2a17e566 100644 --- a/frontend/src/views/ShareSecretPublicPage/components/SecretTable.tsx +++ b/frontend/src/views/ShareSecretPublicPage/components/SecretTable.tsx @@ -16,7 +16,7 @@ export const SecretTable = ({ isUrlCopied, copyUrlToClipboard }: Props) => ( -
+
{isLoading &&
Loading...
} {!isLoading && !decryptedSecret && ( @@ -26,16 +26,18 @@ export const SecretTable = ({ )} {!isLoading && decryptedSecret && ( -
-
-
{decryptedSecret}
+
+
+
+ {decryptedSecret} +
Copy