"use client"; import { IconBrandGoogleFilled } from "@tabler/icons-react"; import { motion } from "motion/react"; import { useTranslations } from "next-intl"; import { Logo } from "@/components/Logo"; import { trackLoginAttempt } from "@/lib/posthog/events"; import { AmbientBackground } from "./AmbientBackground"; export function GoogleLoginButton() { const t = useTranslations("auth"); const handleGoogleLogin = () => { // 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 = `${process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL}/auth/google/authorize-redirect`; }; return (
{/*

Login

*/} {/* Google Logo

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

*/}
{t("continue_with_google")}
); }