diff --git a/lib/models/user.js b/lib/models/user.js index f7e114d3..48a15eea 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -136,7 +136,8 @@ var User = module.exports = Model.extend('User', properties, options); * @param {AccessToken} token The generated access token object */ User.prototype.createAccessToken = function(ttl, cb) { - ttl = Math.min(ttl || User.settings.ttl, User.settings.maxTTL); + var userModel = this.constructor; + ttl = Math.min(ttl || userModel.settings.ttl, userModel.settings.maxTTL); this.accessTokens.create({ ttl: ttl }, cb);