server/app/models/Token.model.js

19 lines
442 B
JavaScript
Raw Normal View History

2020-11-27 01:57:37 +00:00
const { Model } = require('flitter-orm')
const uuid = require('uuid').v4
const gen_token = () => {
return `${uuid()}${uuid()}${uuid()}${uuid()}`.replace(/-/g, '')
}
class Token extends Model {
static get schema() {
return {
user_uuid: String,
token_value: { type: String, default: gen_token },
active: { type: Boolean, default: true },
}
}
}
module.exports = exports = Token