fix: "email not found" Error in Twitter OAuth (#666)

This commit is contained in:
L2
2024-12-02 18:15:16 +09:00
committed by GitHub
parent 1fff8a6964
commit 0507dd3609
2 changed files with 10 additions and 4 deletions

View File

@@ -9,6 +9,15 @@ description: Twitter provider setup and usage.
Get your Twitter credentials from the [Twitter Developer Portal](https://developer.twitter.com/en/portal/dashboard).
Make sure to set the redirect URL to `http://localhost:3000/api/auth/callback/twitter` for local development. For production, you should set it to the URL of your application. If you change the base path of the auth routes, you should update the redirect URL accordingly.
{/*
<Callout type="warn">
If twitter doesn't return the email address, the authentication won't be successful. Make sure to ask for the email address when you create the Twitter app.
</Callout>
*/}
<Callout type="info">
Twitter API v2 does not provide email addresses. As a workaround, the user's `email` field uses the `username` value instead.
</Callout>
</Step>
<Step>
@@ -43,8 +52,5 @@ description: Twitter provider setup and usage.
})
}
```
<Callout type="warn">
If twitter doesn't return the email address, the authentication won't be successful. Make sure to ask for the email address when you create the Twitter app.
</Callout>
</Step>
</Steps>

View File

@@ -144,7 +144,7 @@ export const twitter = (options: TwitterOption) => {
user: {
id: profile.data.id,
name: profile.data.name,
email: profile.data.email || null,
email: profile.data.username || null,
image: profile.data.profile_image_url,
emailVerified: profile.data.verified || false,
},