mirror of
https://github.com/sasjs/server.git
synced 2026-01-12 00:30:06 +00:00
feat: authentication with jwt
This commit is contained in:
26
src/model/User.ts
Normal file
26
src/model/User.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import mongoose from 'mongoose'
|
||||
|
||||
const userSchema = new mongoose.Schema({
|
||||
displayname: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
username: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
password: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
isadmin: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isactive: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
})
|
||||
|
||||
export default mongoose.model('User', userSchema)
|
||||
Reference in New Issue
Block a user