Next.js Discord

Discord Forum

Anyone who has worked with NEXTAUTH GITHUB SCOPE

Unanswered
Basset Bleu de Gascogne posted this in #help-forum
Open in Discord
Avatar
Basset Bleu de GascogneOP
import NextAuth from "next-auth";
import GithubProvider from "next-auth/providers/github";

const scope = ["bio"]


export const authOptions = {

  
    secret: "YegyDIZNJPqxOkGS4K0F/o9l3SjCxCUR4Q/45rGyOtA=",
    providers:[
        GithubProvider({
            clientId:process.env.OAUTH_CLIENT_ID ?? "",
            clientSecret:process.env.OAUTH_CLIENT_SECRET_KEY ?? "",
            authorization :{params:{scope:"read:user user:email repo"}}
        }),
    ],
   
    
}

console.log(authOptions);

export const handler = NextAuth(authOptions);

export {handler as GET, handler as POST};

this is hte code and I wnt to access the repo using the UseSession can some one help me out whats the best way ?

0 Replies