2016-10-07 4 views
0

Я изо всех сил, чтобы получить адрес электронной почты твиттеръюзерами при их входе вHapi Белл Twitter Auth с электронной почтой

я получаю следующее сообщение об ошибке от Joi «Error: Uncaught ошибка: Недопустимое значение опции: должно быть истинным, falsy или объект "

server.auth.strategy('twitter', 'bell', { 
    provider: 'twitter', 
    scope: ['public_profile', 'email'], 
    config: { 
     extendedProfile: true, 
     getParams: 'include_email', 
     getMethod: 'account/verify' 
    }, 
    password: config.longpass, //Use something more secure in production 
    clientId: config.twitter_key, 
    clientSecret: config.twitter_secret, 
    isSecure: config.useHttps //Should be set to true (which is the default) in production 
}); 

ответ

0

Этот код работает для меня.

server.auth.strategy('twitter', 'bell', { 
    provider: 'twitter', 
    config: { 
     getMethod: 'account/verify_credentials', 
     getParams: {include_email:'true' },//doesn't work without quotes! 
    }, 
    password: 'secret_cookie_encryption_password', //Use something more secure in production 
    clientId: secret.twitterId, 
    clientSecret: secret.twitterSecret, 
    isSecure: false //Should be set to true (which is the default) in production 
}); 

Не забудьте предоставить необходимое разрешение (запросить адреса электронной почты от пользователей) в настройках вашего приложения Twitter.