Skip to content

Commit

Permalink
Better differentiation between OAuth 1.0 and 2.0 tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
evanp committed Apr 9, 2018
1 parent 8f4423a commit 0a4c0f9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/app.js
Expand Up @@ -749,21 +749,19 @@ var makeApp = function(configBase, callback) {
} else {
_.each(props.tokens, function(tprops) {
// BearerToken or AccessToken?
if (tprops.scope || !tprops.secret) {
if (tprops.scope || !tprops.token_secret) {
var bprops = _.extend(tprops, {
nickname: user.nickname
});
var bt = new BearerToken(bprops);
bt.save(group());
BearerToken.create(bprops, group());
} else {
var xprops = {
username: user.nickname,
access_token: tprops.token,
token_secret: tprops.token_secret,
consumer_key: tprops.client_id
};
var at = new AccessToken(xprops);
at.save(group());
AccessToken.create(xprops, group());
}
});
}
Expand Down

0 comments on commit 0a4c0f9

Please sign in to comment.