providers/wechat
WeChatProfile
參閱
可索引
[claim
: string
]: unknown
屬性
城市
city: string;
國家
country: string;
頭像網址
headimgurl: string;
暱稱
nickname: string;
openid
openid: string;
特權
privilege: string[];
省份
province: string;
性別
sex: number;
unionid
unionid: string;
default()
default(options): OAuthConfig<WeChatProfile>
將微信登入新增至您的頁面,並向 微信 API 發出請求。
設定
回呼網址
https://example.com/api/auth/callback/wechat
配置
import { Auth } from "@auth/core"
import WeChat from "@auth/core/providers/wechat"
const request = new Request(origin)
const response = await Auth(request, {
providers: [WeChat({
clientId: AUTH_WECHAT_APP_ID,
clientSecret: AUTH_WECHAT_APP_SECRET,
platformType: "OfficialAccount",
})],
})
資源
💡
微信供應商帶有預設配置。若要覆寫您的使用案例的預設值,請查看自訂內建 OAuth 供應商。
參數
參數 | 類型 |
---|---|
options | OAuthUserConfig <WeChatProfile > & { platformType : "OfficialAccount" | "WebsiteApp" ; } |