2016-09-06 40 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。希望它能幫助某人