Battle.net 提供者
资源
设置
回调 URL
https://example.com/api/auth/callback/battlenet
环境变量
AUTH_BATTLENET_ID
AUTH_BATTLENET_SECRET
AUTH_BATTLENET_ISSUER
颁发者必须是以下值之一,基于可用的区域
type BattleNetIssuer =
| "https://www.battlenet.com.cn/oauth"
| "https://us.battle.net/oauth"
| "https://eu.battle.net/oauth"
| "https://kr.battle.net/oauth"
| "https://tw.battle.net/oauth"
配置
/auth.ts
import NextAuth from "next-auth";
import BattleNet from "next-auth/providers/battlenet";
export const { handlers, auth, signIn, signOut } = NextAuth({
providers: [BattleNet({
clientId: AUTH_BATTLENET_CLIENT_ID
clientSecret: AUTH_BATTLENET_CLIENT_SECRET
issuer: AUTH_BATTLENET_ISSUER
})]
});