mirror of
https://github.com/mudabbir-ahmad/peworkshop.git
synced 2026-10-08 03:50:21 +00:00
fixed a bit
This commit is contained in:
1 parent
c7b690c682
commit
5f13bd7102
1 file changed
-30
@@ -1,30 +0,0 @@
|
||||
import NextAuth from 'next-auth';
|
||||
import Providers from 'next-auth/providers';
|
||||
|
||||
export const authOptions = {
|
||||
providers: [
|
||||
Providers.GitHub({
|
||||
clientId: process.env.GITHUB_CLIENT_ID,
|
||||
clientSecret: process.env.GITHUB_CLIENT_SECRET,
|
||||
}),
|
||||
// Add other providers here (e.g., Google, Email, etc.)
|
||||
],
|
||||
secret: process.env.NEXTAUTH_SECRET, // Ensure this is set in your .env file
|
||||
callbacks: {
|
||||
async session(session, user) {
|
||||
// Add custom session properties if needed
|
||||
session.user.id = user.id;
|
||||
session.user.role = user.role; // Example: Add role to session
|
||||
return session;
|
||||
},
|
||||
async jwt(token, user) {
|
||||
if (user) {
|
||||
token.id = user.id;
|
||||
token.role = user.role; // Example: Add role to token
|
||||
}
|
||||
return token;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default NextAuth(authOptions);
|
||||
Reference in new issue
Block a user