passport-local-mongoose = function (schema, options) {
options = options || {};
options.saltlen = options.saltlen || 32;
options.iterations = options.iterations || 25000;
options.keylen = options.keylen || 512;
options.encoding = options.encoding || 'hex';
options.digestAlgorithm = options.digestAlgorithm || 'sha256'; // To get a list of supported hashes use crypto.getHashes()
options.passwordValidator = options.passwordValidator || function(password, cb) { cb(null); };
// Populate field names with defaults if not set
options.usernameField = options.usernameField || 'username';
options.usernameUnique = options.usernameUnique === undefined ? true : options.usernameUnique;
// Populate username query fields with defaults if not set,
// otherwise add username field to query fields.
if (options.usernameQueryFields) {
options.usernameQueryFields.push(options.usernameField);
} else {
options.usernameQueryFields = [options.usernameField];
}
// option to convert username to lowercase when finding
options.usernameLowerCase = options.usernameLowerCase || false;
options.hashField = options.hashField || 'hash';
options.saltField = options.saltField || 'salt';
if (options.limitAttempts) {
options.lastLoginField = options.lastLoginField || 'last';
options.attemptsField = options.attemptsField || 'attempts';
options.interval = options.interval || 100; // 100 ms
options.maxInterval = options.maxInterval || 300000; // 5 min
options.maxAttempts = options.maxAttempts || Infinity;
}
options.errorMessages = options.errorMessages || {};
options.errorMessages.MissingPasswordError = options.errorMessages.MissingPasswordError || 'No password was given';
options.errorMessages.AttemptTooSoonError = options.errorMessages.AttemptTooSoonError || 'Account is currently locked. Try again
later';
options.errorMessages.TooManyAttemptsError = options.errorMessages.TooManyAttemptsError || 'Account locked due to too many failed
login attempts';
options.errorMessages.NoSaltValueStoredError = options.errorMessages.NoSaltValueStoredError || 'Authentication not possible. No
salt value stored';
options.errorMessages.IncorrectPasswordError = options.errorMessages.IncorrectPasswordError || 'Password or username are incorrect
';
options.errorMessages.IncorrectUsernameError = options.errorMessages.IncorrectUsernameError || 'Password or username are incorrect
';
options.errorMessages.MissingUsernameError = options.errorMessages.MissingUsernameError|| 'No username was given';
options.errorMessages.UserExistsError = options.errorMessages.UserExistsError|| 'A user with the given username is already registered
';
var pbkdf2 = function(password, salt, callback) {
if (pbkdf2DigestSupport) {
crypto.pbkdf2(password, salt, options.iterations, options.keylen, options.digestAlgorithm, callback);
} else {
crypto.pbkdf2(password, salt, options.iterations, options.keylen, callback);
}
};
var schemaFields = {};
if (!schema.path(options.usernameField)) {
schemaFields[options.usernameField] = {type: String, unique: options.usernameUnique};
}
schemaFields[options.hashField] = {type: String, select: false};
schemaFields[options.saltField] = {type: String, select: false};
if (options.limitAttempts) {
schemaFields[options.attemptsField] = {type: Number, default: 0};
schemaFields[options.lastLoginField] = {type: Date, default: Date.now};
}
schema.add(schemaFields);
schema.pre('save', function(next) {
// if specified, convert the username to lowercase
if (options.usernameLowerCase && this[options.usernameField]) {
this[options.usernameField] = this[options.usernameField].toLowerCase();
}
next();
});
schema.methods.setPassword = function(password, cb) {
if (!password) {
return cb(new errors.MissingPasswordError(options.errorMessages.MissingPasswordError));
}
var self = this;
options.passwordValidator(password, function(err) {
if (err) {
return cb(err);
}
crypto.randomBytes(options.s ...n/a
errors.AttemptTooSoonError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
errors.AuthenticationError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
errors.IncorrectPasswordError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
errors.IncorrectUsernameError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
errors.MissingPasswordError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
errors.MissingUsernameError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
errors.NoSaltValueStoredError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
errors.TooManyAttemptsError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
errors.UserExistsError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
AttemptTooSoonError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
AuthenticationError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
IncorrectPasswordError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
IncorrectUsernameError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
MissingPasswordError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
MissingUsernameError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
NoSaltValueStoredError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
TooManyAttemptsError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
UserExistsError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
AttemptTooSoonError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
super_ = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
AuthenticationError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
function Error() { [native code] }n/a
IncorrectPasswordError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
super_ = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
IncorrectUsernameError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
super_ = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
MissingPasswordError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
super_ = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
MissingUsernameError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
super_ = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
NoSaltValueStoredError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
super_ = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
TooManyAttemptsError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
super_ = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
UserExistsError = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a
super_ = function () {
if (!(this instanceof ctor)) {
var constructorArgs = Array.prototype.slice.call(arguments);
constructorArgs.unshift(ctor);
return new (ctor.bind.apply(ctor, constructorArgs))();
}
options.inherits.call(this);
if (options.captureStackTrace) {
Error.captureStackTrace && Error.captureStackTrace(this, arguments.callee);
}
copy(parameters, this);
var msg = arguments[0];
if (msg) {
var args = Array.prototype.slice.call(arguments);
if (args.length > 1 && typeof args[args.length - 1] == 'object') {
var instanceParams = args.pop();
copy(instanceParams, this);
}
this.message = util.format.apply(util, args);
}
this.name = name;
}n/a