node-twitter
node-twitter copied to clipboard
Internal Server Error Occurred
Whenever i tried to login, it gives internal server error occurred. Consumer key and Consumer Secret Key are static (which i generated) and getting auth token and auth access token dynamically, when any user enter its credentials in the app.
gettwitterData:['checkInstagramUserExist',function(err,cb){
if(payloadData.TwitterAccessTokenKey && payloadData.TwitterAccessTokenSecret && payloadData.email){
var client = new Twitter({
consumer_key: 'CONSUMER_KEY',
consumer_secret: 'CONSUMER_SECRET_KEY',
access_token_key: payloadData.TwitterAccessTokenKey,
access_token_secret: payloadData.TwitterAccessTokenSecret
});
client.get('statuses/user_timeline', {q: 'node.js'}, function(error, tweets,response) {
if(tweets && tweets.length){
id=tweets[0].user.id
follower=tweets[0].user.followers_count
followed=tweets[0].user.friends_count
fullName=tweets[0].user.name
profilePicture=tweets[0].user.profile_image_url
if(parseInt(follower)<1){
callback('Cant sign up.You don’t have enough followers')
}else{
socialNetworkData.push({
socialLoginId:id,
followers:follower,
following:followed,
type:'TWITTER',
isAccountActive:true,
})
cb(null)
}
}else{
cb(null)
}
});
}else{
cb(null)
}
}]