-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(providers): add WeChat #2519
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nextauthjs/next-auth/FRNFV5uLmPLU4LmLFddiuvQDVsWh |
a93904b
to
84ddade
Compare
84ddade
to
a4cb4aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR! We are close to a new major release, so I kindly ask you to change the base of this PR from main
to next
. Unfortunately, there is a big chance for a few merge conflicts, so the easiest way is to probably to reopen this PR where you base your branch on our next
branch to begin with. I am sorry for the inconvenience, this will hopefully not be required for long.
To comply with the new Provider API, I kindly ask you to incorporate my suggestions. I might have a few more when you have a PR against next
, but I am happy to help you through this to be merged!
I would also like to ask, do you know how we could set up a test account on WeChat to add it to our basic sign-in test suite to ship this with more confidence?
Feel free to ask me anything
} else if (provider.id === 'wechat') { | ||
params.appid = provider.clientId || provider.appid | ||
params.secret = provider.clientSecret; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// WeChat has different url params design | ||
if (provider.id === 'wechat') { | ||
const wechatProfileURL = new URL(url) | ||
|
||
wechatProfileURL.searchParams.append('access_token', results.accessToken) | ||
wechatProfileURL.searchParams.append('openid', results.openid) | ||
|
||
url = wechatProfileURL.href | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id: profile.openid, | ||
nickname: profile.nickname, | ||
avatar: profile.headimgurl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Documentation | ||
|
||
https://developers.weixin.qq.com/doc/offiaccount/en/OA_Web_Apps/Wechat_webpage_authorization.html | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add a Configuration section
authorizationParams: { | ||
appid: options.clientId | ||
}, | ||
protection: "state", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protection: "state", | |
protection: ["state"], |
No worry, I'll take care of this.
not yet, but i think i can figure it out
Thank you, it's very kind of you! |
Hi there! It looks like this issue hasn't had any activity for a while. It will be closed if no further activity occurs. If you think your issue is still relevant, feel free to comment on it to keep it open. (Read more at #912) Thanks! |
Hi there! It looks like this issue hasn't had any activity for a while. To keep things tidy, I am going to close this issue for now. If you think your issue is still relevant, just leave a comment and I will reopen it. (Read more at #912) Thanks! |
I really need this 😿 is there any chance of this moving forward? Sorry, I'm not yet familiar with the code to help. |
we need wechat |
Please support WeChat, WeChat is a commonly used way in China |
we need wechat., please support it ! |
1 similar comment
we need wechat., please support it ! |
World's 18% users are on WeChat. It doesn't make sense to support all other smaller social providers while ignore it. Please add support for WeChatProvider |
Please support wechat |
Reasoning 💡
introduce WeChat OAuth 2.0 provider
Checklist 🧢
Affected issues 🎟