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 登入新增至您的頁面。
設定
回呼網址
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 擴展 BattleNetProfile |
參數
參數 | 類型 |
---|---|
options | OAuthUserConfig <P > & { issuer : BattleNetIssuer ; } |
回傳值
OAuthConfig
<P
>