providers/battlenet
BattleNetProfile
扩展
Record<string,any>
属性
battle_tag
battle_tag: string;sub
sub: string;BattleNetIssuer
type BattleNetIssuer: "https://oauth.battle.net" | "https://oauth.battlenet.com.cn" | "https://www.battlenet.com.cn/oauth" | https://${"us" | "eu" | "kr" | "tw"}.battle.net/oauth;查看 可用区域
default()
default<P>(options): OAuthConfig<P>在您的页面上添加 Battle.net 登录。
设置
回调 URL
https://example.com/api/auth/callback/battlenet配置
import { Auth } from "@auth/core"
import BattleNet from "@auth/core/providers/battlenet"
const request = new Request(origin)
const response = await Auth(request, {
providers: [
BattleNet({
clientId: BATTLENET_CLIENT_ID,
clientSecret: BATTLENET_CLIENT_SECRET,
issuer: BATTLENET_ISSUER,
}),
],
})issuer 必须是以下值之一,基于可用区域
type BattleNetIssuer =
| "https://oauth.battle.net"
| "https://oauth.battlenet.com.cn"
| "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.js 假设 BattleNet 提供商基于 OAuth 2 规范。
💡
BattleNet 提供商附带 默认配置。要为您的用例覆盖默认值,请查看 自定义内置 OAuth 提供商。
类型参数
| 类型参数 |
|---|
P extends BattleNetProfile |
参数
| 参数 | 类型 |
|---|---|
options | OAuthUserConfig<P> & { issuer: BattleNetIssuer; } |
返回
OAuthConfig<P>