2016-09-06 82 views
0

伙计们,我在我的应用程序中使用passport-trello进行用户身份验证。passportjs,tokenSecret返回一个空对象

export default() => { 
    passport.use(new TrelloStrategy({ 
    consumerKey: process.env.TRELLO_CONSUMER_KEY, 
    consumerSecret: process.env.TRELLO_CONSUMER_SECRET, 
    callbackURL: 'http://localhost:3000/auth/trello/callback', 
    trelloParams: { 
     scope: 'read', 
     name: 'Common Feed', 
     expiration: '1hour' 
    } 
    }, (req, token, tokenSecret, profile, done) => { 
     let user = {}; 
     user.token = token; 
     user.tokenSecret = tokenSecret; 
     user.profile = profile; 
     done(null, user); 
    })); 
} 

当我试图注销用户对象事实证明,user.tokenSecret返回一个空的对象,而其他道具充满了相应的信息。我想知道是否有人有这个问题,为什么碰巧如此。谢谢

回答

0

我想出req这个参数就是那个tokenSecret!奇怪的行为,但它是什么。 req返回一个字符串,您可以使用该字符串访问Trello的API。希望它能帮助某人