mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-30 02:46:44 -05:00
fix: "email not found" Error in Twitter OAuth (#666)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user