Changed tokens from an object of objects to just an array, Tumblr strategy now pushes a new token in addition to tokenSecret as well as token kind

This commit is contained in:
Sahat Yalkabov
2013-12-07 02:17:46 -05:00
parent cbc9ec3506
commit c03d62da08
3 changed files with 11 additions and 10 deletions

View File

@@ -104,7 +104,7 @@ passport.use('tumblr', new OAuthStrategy({
},
function (req, token, tokenSecret, profile, done) {
User.findById(req.user._id, function(err, user) {
user.tokens.tumblr = token;
user.tokens.push({ kind: 'tumblr', token: token, tokenSecret: tokenSecret });
user.save(function(err) {
done(err, req.user);
});