1 module.exports = function (sequelize, DataTypes) {
2 const OAuthClient = sequelize.define('OAuthClient',
5 type: DataTypes.STRING,
9 type: DataTypes.STRING,
13 type: DataTypes.ARRAY(DataTypes.STRING)
16 type: DataTypes.ARRAY(DataTypes.STRING)
22 fields: [ 'clientId' ],
26 fields: [ 'clientId', 'clientSecret' ],
41 // ---------------------------------------------------------------------------
43 function countTotal (callback) {
44 return this.count().asCallback(callback)
47 function loadFirstClient (callback) {
48 return this.findOne().asCallback(callback)
51 function getByIdAndSecret (clientId, clientSecret) {
55 clientSecret: clientSecret
59 return this.findOne(query)