diff --git a/frontend/src/layouts/AppLayout/AppLayout.tsx b/frontend/src/layouts/AppLayout/AppLayout.tsx index 6a91bce67..89b7c7795 100644 --- a/frontend/src/layouts/AppLayout/AppLayout.tsx +++ b/frontend/src/layouts/AppLayout/AppLayout.tsx @@ -82,6 +82,7 @@ import { Workspace } from "@app/hooks/api/types"; import { useUpdateUserProjectFavorites } from "@app/hooks/api/users/mutation"; import { useGetUserProjectFavorites } from "@app/hooks/api/users/queries"; import { AuthMethod } from "@app/hooks/api/users/types"; +import { InsecureConnectionBanner } from "@app/layouts/AppLayout/components/InsecureConnectionBanner"; import { navigateUserToOrg } from "@app/views/Login/Login.utils"; import { Mfa } from "@app/views/Login/Mfa"; import { CreateOrgModal } from "@app/views/Org/components"; @@ -1023,6 +1024,7 @@ export const AppLayout = ({ children }: LayoutProps) => { onClose={() => handlePopUpToggle("createOrg", false)} />
+ {!window.isSecureContext && } {children}
diff --git a/frontend/src/layouts/AppLayout/components/InsecureConnectionBanner/InsecureConnectionBanner.tsx b/frontend/src/layouts/AppLayout/components/InsecureConnectionBanner/InsecureConnectionBanner.tsx new file mode 100644 index 000000000..42bb433d8 --- /dev/null +++ b/frontend/src/layouts/AppLayout/components/InsecureConnectionBanner/InsecureConnectionBanner.tsx @@ -0,0 +1,37 @@ +import { useState } from "react"; +import { faWarning, faX } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; + +import { IconButton } from "@app/components/v2"; + +export const InsecureConnectionBanner = () => { + const [isAcknowledged, setIsAcknowledged] = useState( + localStorage.getItem("insecureConnectionAcknowledged") ?? false + ); + + const handleDismiss = () => { + setIsAcknowledged(true); + localStorage.setItem("insecureConnectionAcknowledged", "true"); + }; + + if (isAcknowledged) return null; + + return ( +
+ + + Your connection to this Infisical instance is not secured via HTTPS. Some features may not + behave as expected. + + + + +
+ ); +}; diff --git a/frontend/src/layouts/AppLayout/components/InsecureConnectionBanner/index.tsx b/frontend/src/layouts/AppLayout/components/InsecureConnectionBanner/index.tsx new file mode 100644 index 000000000..a09b35764 --- /dev/null +++ b/frontend/src/layouts/AppLayout/components/InsecureConnectionBanner/index.tsx @@ -0,0 +1 @@ +export * from "./InsecureConnectionBanner";