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

@@ -16,6 +16,7 @@
"gsap": "^3.14.2", "gsap": "^3.14.2",
"lucide-react": "^0.575.0", "lucide-react": "^0.575.0",
"next": "16.1.6", "next": "16.1.6",
"next-auth": "^4.24.13",
"pg": "^8.18.0", "pg": "^8.18.0",
"react": "19.2.3", "react": "19.2.3",
"react-dom": "19.2.3" "react-dom": "19.2.3"

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;
},
},
});

1291
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff