Skip to content

Commit

Permalink
auth
Browse files Browse the repository at this point in the history
  • Loading branch information
bellesea committed Aug 20, 2023
1 parent 5f99895 commit 93a9639
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pages/api/auth/[...nextauth].js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import NextAuth from "next-auth"
import GithubProvider from "next-auth/providers/github";

const CLIENT_ID = process.env.CLIENT_ID
const CLIENT_SECRET = process.env.CLIENT_SECRET

export default NextAuth({
providers: [
GithubProvider({
clientId: CLIENT_ID,
clientSecret: CLIENT_SECRET,
authorization: { params: { scope: "read:user user:email" } },
profile(profile) {
return {
name: profile.login,
email: profile.email,
image: profile.avatar_url,
id: profile.id.toString(),
githubId: profile.id.toString(),
githubUsername: profile.login,
};
},
}),
],
secret: process.env.NEXTAUTH_SECRET,
});

0 comments on commit 93a9639

Please sign in to comment.