This video is part of the following playlists:
Learn how to add auth to your next application using next auth and github login. All of the code examples are using next 13, but use the pages directory, not the app directory.
Note
unstable_getServerSession
has now been renamed to getServerSession
.
https://github.com/Sam-Meech-Ward/code_snippets_prisma_next_demo/tree/auth
// /pages/api/auth/[...nextauth].js
import NextAuth from "next-auth"
import GithubProvider from "next-auth/providers/github"
export const authOptions = {
providers: [
GithubProvider({
clientId: process.env.GITHUB_ID,
clientSecret: process.env.GITHUB_SECRET,
}),
// ...add more providers here
],
}
export default NextAuth(authOptions)
Find an issue with this page? Fix it on GitHub