From 4b6dcd6271958c1f7512efef63eb1c2b30058606 Mon Sep 17 00:00:00 2001 From: Ritchie Martori Date: Wed, 4 Feb 2015 14:09:01 -0800 Subject: [PATCH] Document user settings --- common/models/user.js | 11 +++++++++++ lib/persisted-model.js | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/common/models/user.js b/common/models/user.js index 8551d377..f5f1a8c0 100644 --- a/common/models/user.js +++ b/common/models/user.js @@ -46,6 +46,17 @@ var debug = require('debug')('loopback:user'); * @property {String} email Must be valid email * @property {Boolean} emailVerified Set when a user's email has been verified via `confirm()` * @property {String} verificationToken Set when `verify()` is called + * @property {Object} settings Extends the `Model.settings` object. + * @property {Boolean} settings.emailVerificationRequired Require the email verification + * process before allowing a login. + * @property {Number} settings.ttl Default time to live (in seconds) for the `AccessToken` created by `User.login() / user.createAccessToken()`. + * Default is `1209600` (2 weeks) + * @property {Number} settings.maxTTL The max value a user can request a token to be alive / valid for. + * Default is `31556926` (1 year) + * @property {Boolean} settings.realmRequired Require a realm when logging in a user + * @property {String} settings.realmDelimiter When set a realm is required + * @property {Number} settings.resetPasswordTokenTTL Time to live for password reset `AccessToken`. Default is `900` (15 minutes) + * @property {Number} settings.saltWorkFactor The `bcrypt` salt work factor. Default is `10`. * * @class User * @inherits {PersistedModel} diff --git a/lib/persisted-model.js b/lib/persisted-model.js index 98ce9775..8eb671fa 100644 --- a/lib/persisted-model.js +++ b/lib/persisted-model.js @@ -159,7 +159,9 @@ PersistedModel.findById = function find(id, cb) { *
See [Where filter](http://docs.strongloop.com/display/LB/Where+filter). * * @param {Function} Callback function called with `(err, returned-instances)`. - * @returns {Object} Array of model instances that match the filter; or Error. + * @callback {Function} callback + * @param {Error} err + * @param {Array} models Model instances matching the filter */ PersistedModel.find = function find(params, cb) {