aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/oauth-token.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/oauth-token.js')
-rw-r--r--server/models/oauth-token.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/server/models/oauth-token.js b/server/models/oauth-token.js
index c9108bf95..f8de4e916 100644
--- a/server/models/oauth-token.js
+++ b/server/models/oauth-token.js
@@ -1,3 +1,5 @@
1'use strict'
2
1const logger = require('../helpers/logger') 3const logger = require('../helpers/logger')
2 4
3// --------------------------------------------------------------------------- 5// ---------------------------------------------------------------------------
@@ -6,16 +8,20 @@ module.exports = function (sequelize, DataTypes) {
6 const OAuthToken = sequelize.define('OAuthToken', 8 const OAuthToken = sequelize.define('OAuthToken',
7 { 9 {
8 accessToken: { 10 accessToken: {
9 type: DataTypes.STRING 11 type: DataTypes.STRING,
12 allowNull: false
10 }, 13 },
11 accessTokenExpiresAt: { 14 accessTokenExpiresAt: {
12 type: DataTypes.DATE 15 type: DataTypes.DATE,
16 allowNull: false
13 }, 17 },
14 refreshToken: { 18 refreshToken: {
15 type: DataTypes.STRING 19 type: DataTypes.STRING,
20 allowNull: false
16 }, 21 },
17 refreshTokenExpiresAt: { 22 refreshTokenExpiresAt: {
18 type: DataTypes.DATE 23 type: DataTypes.DATE,
24 allowNull: false
19 } 25 }
20 }, 26 },
21 { 27 {
@@ -33,11 +39,6 @@ module.exports = function (sequelize, DataTypes) {
33 return OAuthToken 39 return OAuthToken
34} 40}
35 41
36// TODO: validation
37// OAuthTokenSchema.path('accessToken').required(true)
38// OAuthTokenSchema.path('client').required(true)
39// OAuthTokenSchema.path('user').required(true)
40
41// --------------------------------------------------------------------------- 42// ---------------------------------------------------------------------------
42 43
43function associate (models) { 44function associate (models) {