mirror of
https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-consumer.git
synced 2026-09-21 16:52:03 -07:00
Made salt key not required
Mongoose's validation kept blocking the operation. We need this to go through to the pre-save hook
This commit is contained in:
+2
-1
@@ -6,7 +6,7 @@ const User = new mongoose.Schema({
|
||||
name: { type: String },
|
||||
username: { type: String, required: true, unique: true },
|
||||
password: { type: String, required: true },
|
||||
salt: { type: String, required: true }
|
||||
salt: { type: String }
|
||||
})
|
||||
|
||||
User.pre('save', function(next) {
|
||||
@@ -23,6 +23,7 @@ User.pre('save', function(next) {
|
||||
if(err) { return next(err) }
|
||||
|
||||
user.password = hash
|
||||
user.salt = salt
|
||||
next()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user