A Next.js 14 application delivering the creator β upload β library β play loop with authentication, Prisma/Postgres, S3-compatible storage, search, and analytics.
41a1d8d
verified
| ```typescript | |
| import NextAuth from "next-auth" | |
| import GoogleProvider from "next-auth/providers/google" | |
| import GitHubProvider from "next-auth/providers/github" | |
| import { PrismaAdapter } from "@auth/prisma-adapter" | |
| import { prisma } from "@/lib/prisma" | |
| export const authOptions = { | |
| adapter: PrismaAdapter(prisma), | |
| providers: [ | |
| GoogleProvider({ | |
| clientId: process.env.GOOGLE_CLIENT_ID, | |
| clientSecret: process.env.GOOGLE_CLIENT_SECRET, | |
| }), | |
| GitHubProvider({ | |
| clientId: process.env.GITHUB_CLIENT_ID, | |
| clientSecret: process.env.GITHUB_CLIENT_SECRET, | |
| }), | |
| ], | |
| secret: process.env.NEXTAUTH_SECRET, | |
| } | |
| const handler = NextAuth(authOptions) | |
| export { handler as GET, handler as POST } | |
| ``` |