UNPKG

auth-center

Version:
46 lines (42 loc) 986 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = _default; var _util = require("../util"); function _default(sequelize, DataTypes) { return sequelize.define('Token', { id: { type: DataTypes.STRING(40), defaultValue: _util.generateId, primaryKey: true, comment: 'Access Token' }, client_id: { type: DataTypes.STRING(100), allowNull: false, comment: 'Client Id' }, user_id: { type: DataTypes.BIGINT.UNSIGNED, allowNull: false, comment: 'User Id' }, ttl: { type: DataTypes.INTEGER.UNSIGNED, allowNull: false, comment: 'Time To Live (Second)' }, refresh_token: { type: DataTypes.STRING(40), defaultValue: _util.generateId, unique: true, allowNull: false, comment: 'Refresh Token' } }, { tableName: 'token', comment: 'Access Token Table' }); } module.exports = exports.default;