2025-09-07 22:57:43 +00:00
|
|
|
// src/auth.ts
|
|
|
|
|
import NextAuth from "next-auth";
|
|
|
|
|
import Google from "next-auth/providers/google";
|
|
|
|
|
|
|
|
|
|
export const { handlers, auth, signIn, signOut } = NextAuth({
|
|
|
|
|
providers: [
|
|
|
|
|
Google({
|
|
|
|
|
clientId: process.env.GOOGLE_CLIENT_ID!,
|
|
|
|
|
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
2025-09-08 18:30:34 +00:00
|
|
|
events: {
|
|
|
|
|
async signIn({ user, account, profile }) {
|
|
|
|
|
console.log("[NextAuth] signIn user:", {
|
|
|
|
|
id: (user as any)?.id,
|
|
|
|
|
name: user?.name,
|
|
|
|
|
email: user?.email,
|
|
|
|
|
image: (user as any)?.image,
|
|
|
|
|
provider: account?.provider,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-09-07 22:57:43 +00:00
|
|
|
});
|