We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a73898 commit bef04e6Copy full SHA for bef04e6
src/models/User.ts
@@ -1,4 +1,4 @@
1
-import bcrypt from 'bcrypt-nodejs';
+import bcrypt from 'bcrypt';
2
import { Document, Schema, Error, model } from 'mongoose';
3
4
export type UserDocument = Document & {
@@ -41,9 +41,7 @@ const userSchema = new Schema({
41
}
42
}, { timestamps: true });
43
44
-/**
45
- * Password hash middleware.
46
- */
+// 비밀번호 암호화
47
userSchema.pre('save', function save(next) {
48
const user = this as UserDocument;
49
if (!user.isModified('password')) { return next(); }
0 commit comments