Skip to content

Instantly share code, notes, and snippets.

@Tribhuwan-Joshi
Created October 25, 2023 11:48
Show Gist options
  • Save Tribhuwan-Joshi/745cb4590b40ead7ce5051fa8a1a7644 to your computer and use it in GitHub Desktop.
Save Tribhuwan-Joshi/745cb4590b40ead7ce5051fa8a1a7644 to your computer and use it in GitHub Desktop.
Add Auth in Next13
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 ?? "",
}),
],
};
export 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