S
S
sergeygarnov2014-09-25 10:13:26
Node.js
sergeygarnov, 2014-09-25 10:13:26

How to get profileUrl for twitter in PassportJS?

Surely many who worked with this module faced the need to implement login to the site through Twitter. Actually, the question is the following, I logged in through Facebook, VK - in the responses from these api there is such a field as profileUrl. Twitter does not have it, maybe someone faced this problem? The maximum solution I came up with is to take profile.id and concatenate it with https://twitter.com/intent/user?user_id=%my_id%, but in this case we have some kind of cropped version of the profile, but with the ability to transition to full. I would like, of course, to have a link like https://twitter.com/%username%

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Philipp, 2014-09-25
@zoonman

Didn't work with PassportJS. Is there no profile.screen_name property there? Try dumping the profile object

console.log(profile);
console.dir(profile);

S
sergeygarnov, 2014-09-25
@sergeygarnov

thank you very much! just what you need)
although not completely, but with the help of " https://twitter.com/ " + profile.username you can get what you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question