JRPG AddictJ
Convex Community9mo ago
1 reply
JRPG Addict

How to force consent screen on log in? (Google OAuth + Convex Auth)

When I sign in using Google OAuth with Convex, I don't get the option to pick an account. It just automatically logs in with the latest account. How do I force account selection every time the user clicks the login button?

For reference, this is how my login component looks like:
"use client";

import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
import { useAuthActions } from "@convex-dev/auth/react";
import { useTranslations } from "next-intl";
import { FaGoogle } from "react-icons/fa";

export default function GoogleAuth({
  className,
  isIcon,
}: {
  className?: string;
  isIcon?: boolean;
}) {
  const { signIn } = useAuthActions();
  const t = useTranslations("Auth");

  return (
    <Button onClick={() => signIn("google")} className={cn(className)}>
      <FaGoogle />
      {!isIcon && t("signIn")}
    </Button>
  );
}
Was this page helpful?