diff --git a/index.js b/index.js index c8c468a..5415149 100755 --- a/index.js +++ b/index.js @@ -78,8 +78,8 @@ module.exports = function (schema, options) { 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 }; + schemaFields[options.hashField] = { type: String, select: false, immutable: true}; + schemaFields[options.saltField] = { type: String, select: false, immutable: true }; if (options.limitAttempts) { schemaFields[options.attemptsField] = { type: Number, default: 0 };