19 lines
442 B
JavaScript
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
|