some api routes
This commit is contained in:
		
							parent
							
								
									6591e0987f
								
							
						
					
					
						commit
						6e58f59274
					
				
					 39 changed files with 324 additions and 21 deletions
				
			
		|  | @ -1,11 +1,21 @@ | |||
| import NextAuth from "next-auth"; | ||||
| import DiscordProvider from "next-auth/providers/discord"; | ||||
| import { PrismaAdapter } from "@next-auth/prisma-adapter"; | ||||
| import prisma from "../../../lib/prisma"; | ||||
| 
 | ||||
| export default NextAuth({ | ||||
|   adapter: PrismaAdapter(prisma), | ||||
|   providers: [ | ||||
|     DiscordProvider({ | ||||
|       clientId: process.env.DISCORD_CLIENT_ID, | ||||
|       clientSecret: process.env.DISCORD_CLIENT_SECRET, | ||||
|     }), | ||||
|   ], | ||||
|   callbacks: { | ||||
|     async session({ session, token, user }) { | ||||
|       session.user.id = user.id; | ||||
|       console.log(JSON.stringify(user)); | ||||
|       return session; | ||||
|     }, | ||||
|   }, | ||||
| }); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue