aboutsummaryrefslogtreecommitdiff
path: root/src/server/authentication/DashUserModel.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-04-30 01:10:20 -0400
committerbobzel <zzzman@gmail.com>2024-04-30 01:10:20 -0400
commit6de58d7ecbfd14beb7389c6ff56e764b5c00ba25 (patch)
tree57b396b30644ac2fa3ec48fe38bc3efb419ce88d /src/server/authentication/DashUserModel.ts
parente17737982ea2ce84b4bded798ee7bdf730a75715 (diff)
changed acl- and some other field- to acl_ and field_ style
Diffstat (limited to 'src/server/authentication/DashUserModel.ts')
-rw-r--r--src/server/authentication/DashUserModel.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/authentication/DashUserModel.ts b/src/server/authentication/DashUserModel.ts
index a288bfeab..bfa6d7bdb 100644
--- a/src/server/authentication/DashUserModel.ts
+++ b/src/server/authentication/DashUserModel.ts
@@ -61,7 +61,7 @@ const userSchema = new mongoose.Schema(
* Password hash middleware.
*/
userSchema.pre('save', function save(next) {
- const user = this as any as DashUserModel;
+ const user = this;
if (!user.isModified('password')) {
return next();
}
@@ -70,7 +70,7 @@ userSchema.pre('save', function save(next) {
return next(err);
}
bcrypt.hash(
- user.password,
+ user.password ?? '',
salt,
() => {},
(cryptErr: mongoose.Error, hash: string) => {