mirror of
https://github.com/sasjs/server.git
synced 2026-01-09 07:20:05 +00:00
feat: JWT saved in DB + logout api added
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import mongoose from 'mongoose'
|
||||
import { string } from 'joi'
|
||||
import mongoose, { Schema } from 'mongoose'
|
||||
|
||||
const userSchema = new mongoose.Schema({
|
||||
displayname: {
|
||||
@@ -20,7 +21,23 @@ const userSchema = new mongoose.Schema({
|
||||
isactive: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
tokens: [
|
||||
{
|
||||
clientid: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
accesstoken: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
refreshtoken: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
export default mongoose.model('User', userSchema)
|
||||
|
||||
Reference in New Issue
Block a user