"use client"; import { useTranslations } from "next-intl"; import { useState } from "react"; import { Logo } from "@/components/Logo"; import { Button } from "@/components/ui/button"; import { trackLoginAttempt } from "@/lib/posthog/events"; import { AmbientBackground } from "./AmbientBackground"; <<<<<<< HEAD function GoogleGLogo({ className }: { className?: string }) { return ( ); } ======= import { BACKEND_URL } from "@/lib/env-config"; >>>>>>> 1127aedb4 (refactor(env): replace inline process.env reads with BACKEND_URL in editor, chat, dashboard and settings) export function GoogleLoginButton() { const t = useTranslations("auth"); const [isRedirecting, setIsRedirecting] = useState(false); const handleGoogleLogin = () => { if (isRedirecting) return; setIsRedirecting(true); // Track Google login attempt trackLoginAttempt("google"); // IMPORTANT: Use the redirect-based authorize endpoint for cross-origin OAuth // This fixes CSRF cookie issues in Firefox/Safari where cookies set via // cross-origin fetch requests may not be sent on subsequent redirects. // The authorize-redirect endpoint does a server-side redirect to Google // and sets the CSRF cookie properly for same-site context. window.location.href = `${BACKEND_URL}/auth/google/authorize-redirect`; }; return (
{/*

Login

*/} {/* Google Logo

{t("cloud_dev_notice")}{" "} {t("docs")} {" "} {t("cloud_dev_self_hosted")}

*/}
); }