providers/wechat
WeChatProfile
See
Indexable
[claim
: string
]: unknown
Properties
city
city: string;
country
country: string;
headimgurl
headimgurl: string;
nickname
nickname: string;
openid
openid: string;
privilege
privilege: string[];
province
province: string;
sex
sex: number;
unionid
unionid: string;
default()
default(options): OAuthConfig<WeChatProfile>
Add WeChat login to your page and make requests to WeChat APIs.
Setup
Callback URL
https://example.com/api/auth/callback/wechat
Configuration
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",
})],
})
Resources
- WeChat Official Account
- WeChat Official Account - Webpage Authorization
- WeChat Official Account Test Account
- WeChat WebsiteApp Login
- 使用微信测试账号对网页进行授权
💡
The WeChat provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.
Disclaimer If you think you found a bug in the default configuration, you can open an issue.
Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, we might not pursue a resolution. You can ask for more help in Discussions.
Parameters
Parameter | Type |
---|---|
options | OAuthUserConfig <WeChatProfile > & { platformType : "OfficialAccount" | "WebsiteApp" ; } |