Skip to content

Commit 80f0d27

Browse files
committed
Added some basic changes nend to implement route fixes
1 parent 8c2ed4e commit 80f0d27

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

shatter-backend/src/models/user_model.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { Schema, model } from 'mongoose';
99
export interface IUser {
1010
name: string;
1111
email: string;
12+
password: string;
1213
}
1314

1415
// Create the Mongoose Schema (the database blueprint)
@@ -28,6 +29,11 @@ const UserSchema = new Schema<IUser>(
2829
trim: true,
2930
lowercase: true, // converts all emails to lowercase before saving for consistency
3031
unique: true // enforce uniqueness, error 11000 if duplicate is detected
32+
},
33+
password: {
34+
type: String,
35+
required: true,
36+
select: false // exclude password field by default when querying users for security
3137
}
3238
},
3339
{

0 commit comments

Comments
 (0)