Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

prevent signin clickjacking

AykutSarac9af53e557154
diff --git a/next.config.js b/next.config.js
index 316d705c..4710d197 100644
--- a/next.config.js
+++ b/next.config.js
@@ -13,19 +13,6 @@ const config = {
compiler: {
styledComponents: true,
},
- async headers() {
- return [
- {
- source: "/sign-in",
- headers: [
- {
- key: "X-Frame-Options",
- value: "SAMEORIGIN",
- },
- ],
- },
- ];
- },
};
const bundleAnalyzerConfig = withBundleAnalyzer(config);
diff --git a/src/pages/sign-in.tsx b/src/pages/sign-in.tsx
index b886c24e..140113fb 100644
--- a/src/pages/sign-in.tsx
+++ b/src/pages/sign-in.tsx
@@ -20,6 +20,7 @@ import { toast } from "react-hot-toast";
import { AiOutlineGithub, AiOutlineGoogle } from "react-icons/ai";
import Layout from "src/layout/Layout";
import { supabase } from "src/lib/api/supabase";
+import { isIframe } from "src/lib/utils/widget";
import useUser from "src/store/useUser";
export function AuthenticationForm(props: PaperProps) {
@@ -185,9 +186,8 @@ const SignIn = () => {
const isPasswordReset = query?.type === "recovery" && !query?.error;
React.useEffect(() => {
- if (isReady && session && !isPasswordReset) {
- push("/editor");
- }
+ if (isIframe()) push("/");
+ if (isReady && session && !isPasswordReset) push("/editor");
}, [isReady, session, push, isPasswordReset]);
return (