Set up Google OAuth with next-auth and prepared for user table creation

This commit is contained in:
2026-02-22 09:16:08 +05:30
parent 563636862e
commit 19f2e71baf
3 changed files with 937 additions and 372 deletions

View File

@@ -0,0 +1,17 @@
import NextAuth from 'next-auth';
import GoogleProvider from 'next-auth/providers/google';
export default NextAuth({
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
}),
],
callbacks: {
async session({ session, token }) {
session.user.id = token.sub;
return session;
},
},
});