"use server";
import { signIn } from "@/lib/auth/auth";

/**
 * Kicks off the Google OAuth flow. On success NextAuth redirects to
 * /account (via redirectTo). On rejection (email not in `users` as active)
 * the signIn callback in auth.ts routes to /login?error=... — that Response
 * is thrown by signIn() and bubbles up through the server action, so we
 * don't catch it here.
 */
export async function signInWithGoogleAction() {
  await signIn("google", { redirectTo: "/account" });
}
