import React from "react"; import { GoogleLogin } from "@react-oauth/google"; export default function Login({ onDone }) { return (
Sign in to netIntel
{ const r = await fetch("/api/auth/google", { method: "POST", headers: { "Content-Type": "application/json" }, credentials: "include", body: JSON.stringify({ credential: cred.credential }), }); if (r.ok) onDone?.(); else console.error(await r.json()); }} onError={() => console.error("Google login failed")} />
); }