Next-auth redirects me on auth/error on signIn()

I'm using app router in nextjs, when I call signIn("google") in localhost, next-auth works pretty well but on production, it redirects me instantly on api/auth/error route

this is my app/api/auth/[...next-auth]/route.ts look like
import { env } from "@/env";
import NextAuth, { type NextAuthOptions } from "next-auth";
import GoogleProvider from "next-auth/providers/google";

export const authOptions: NextAuthOptions = {
  providers: [
    GoogleProvider({
      clientId: env.GOOGLE_CLIENT_ID,
      clientSecret: env.GOOGLE_SECRET,
    }),
    
  ],
  session: { strategy: "jwt" }
};

const handler = NextAuth(authOptions);
export { handler as GET, handler as POST };


what can be problem? in production I think, env are all good
Was this page helpful?