2016-10-07 14 views
0

我掙扎時,他們登錄哈皮貝爾Twitter的驗證與電子郵件

我從穰收到以下錯誤讓Twitter用戶的電子郵件地址「錯誤:未捕獲的錯誤:無效選項值:必須是真實的,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應用程序設置中允許必要的權限(請求來自用戶的電子郵件地址)。