server/app/models/Token.model.js
2020-11-26 19:57:37 -06:00

19 lines
442 B
JavaScript

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