Skip to content

Instantly share code, notes, and snippets.

@balazsorban44
Created February 22, 2023 01:32
Show Gist options
  • Save balazsorban44/0b97f96f90941706f8d7ea9bfa50c1d0 to your computer and use it in GitHub Desktop.
Save balazsorban44/0b97f96f90941706f8d7ea9bfa50c1d0 to your computer and use it in GitHub Desktop.
// app/api/auth/[...nextauth]/route.ts
import NextAuth, { type NextAuthOptions } from "next-auth"
import GitHub from "next-auth/providers/github"
export const authOptions: NextAuthOptions = {
providers: [
GitHub({
clientId: process.env.GITHUB_ID,
clientSecret: process.env.GITHUB_SECRET,
}),
],
}
const handler = NextAuth(authOptions)
export { handler as GET, handler as POST }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment