Next.js Discord

Discord Forum

How do you select an issuer depending on the region button the user selects?

Unanswered
German Longhaired Pointer posted this in #help-forum
Open in Discord
German Longhaired PointerOP
Say that I have some buttons US, EU, CN, etc. I would like the issuer to change depending on what button the user clicked on on the interface. Is there a way to grab this information from the interace and send it to [...nextauth].ts? Is this the approach I should be doing?

I'll post part of the [...nextauth].ts file here just in case:

export const authConfig = ():NextAuthOptions => {
    return ({

    providers: [
        BattleNetProvider({
            clientId: process.env.BNET_CLIENT_ID as string,
            clientSecret: process.env.BNET_CLIENT_SECRET as string,
            issuer: "https://us.battle.net/oauth",
            
            authorization: {
                
                params:{
                    client_id: process.env.BNET_CLIENT_ID ,
                    scope:"openid wow.profile sc2.profile d3.profile",  
                    redirect_uri: process.env.BNET_REDIRECT_URL, 
                    response_type:"code"}
            }

        })
    ],
    callbacks: {
    async jwt({ token, account }) {
        // Persist the OAuth access_token to the token right after signin
        if (account) {
        token.accessToken = account.access_token
        }
        return token
    },
    async session({ session, token, user } )  {
        // Send properties to the client, like an access_token from a provider.
        session.accessToken = token.accessToken as string
        return session
    }
    },
  

    })

}

4 Replies

German Longhaired PointerOP
bumping this
German Longhaired PointerOP
bumping this again
German Longhaired PointerOP
bump
German Longhaired PointerOP
bump