initial commit. phase 1 complete

This commit is contained in:
2026-05-05 20:45:19 +02:00
parent d9c68313a0
commit 89e058ffac
20631 changed files with 3224610 additions and 43 deletions
+32
View File
@@ -0,0 +1,32 @@
import type { OAuthConfig, OAuthUserConfig } from "."
export interface BattleNetProfile extends Record<string, any> {
sub: string
battle_tag: string
}
/** See the [available regions](https://develop.battle.net/documentation/guides/regionality-and-apis) */
export type BattleNetIssuer =
| "https://www.battlenet.com.cn/oauth"
| `https://${"us" | "eu" | "kr" | "tw"}.battle.net/oauth`
export default function BattleNet<P extends BattleNetProfile>(
options: OAuthUserConfig<P> & { issuer: BattleNetIssuer }
): OAuthConfig<P> {
return {
id: "battlenet",
name: "Battle.net",
type: "oauth",
wellKnown: `${options.issuer}/.well-known/openid-configuration`,
profile(profile) {
return {
id: profile.sub,
name: profile.battle_tag,
email: null,
image: null,
}
},
style: { logo: "/battlenet.svg", bg: "#148eff", text: "#fff" },
options,
}
}