Set up Google OAuth with next-auth and prepared for user table creation
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
"gsap": "^3.14.2",
|
||||
"lucide-react": "^0.575.0",
|
||||
"next": "16.1.6",
|
||||
"next-auth": "^4.24.13",
|
||||
"pg": "^8.18.0",
|
||||
"react": "19.2.3",
|
||||
"react-dom": "19.2.3"
|
||||
|
||||
17
pages/api/auth/[...nextauth].js
Normal file
17
pages/api/auth/[...nextauth].js
Normal 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
1291
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user