How to access numerical X (formerly Twitter) ID and/or handle during authentication with X? #12408
Unanswered
schandillia
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using Auth.js in my NextJS 15 project to authenticate using X. Right now, my
src/auth.ts
is set up as follows:The
session
object returned by X, which I am printing withconsole.log()
, is currently showing only 3 values:While I don’t necessarily need the user’s
email
, I do need their XID
, a numerical value with 19 digits. Is there any way to retrieve this information upon authentication? If not, what is the workaround? Because without a unique identifier from X, how does one store the user’s profile to database? Later if I wish to post something to X in user’s behalf, how would I identify the user’s account without the ID?Beta Was this translation helpful? Give feedback.
All reactions