You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
442 B

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