Failed login with X (twitter) getting unable_to_get_user_info & wrong scope with X Oauth

This is what my
auth.ts
file config looks like:

socialProviders: {
    twitter: {
      clientId: process.env.TWITTER_CLIENT_ID as string,
      clientSecret: process.env.TWITTER_CLIENT_SECRET as string,
      scope: [
        "tweet.read",
        "tweet.write", 
        "users.read",
        "user.email"
      ],
    },
  },


When I pass user.email I get an invalid scope response (invalid_scope), and when I don't pass user.email I get unable_to_get_user_info

I followed the docs (https://www.better-auth.com/docs/authentication/twitter) espeically the part that says:

Twitter API v2 now supports email address retrieval. Make sure to request the user.email scope when configuring your Twitter app to enable this feature.

Just a bit confused on what is happening:

cc @Ping
Twitter provider setup and usage.
Was this page helpful?