1
0
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:
Saad Jutt
2021-11-02 03:13:16 +05:00
parent f1e464d4a4
commit 22dfcfddb9
12 changed files with 13816 additions and 53 deletions

26
src/model/User.ts Normal file
View 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)