aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/oauth-client.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-12-28 15:49:23 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-12-28 15:49:23 +0100
commit67bf9b96bbcd92b069fe86d9223fe0f8b9c6e677 (patch)
treebae6a9b0c3133c9cc38a2972222b5991f0cf614e /server/models/oauth-client.js
parent552cc9d646e78edae8b0fe61564d4e49db0b6206 (diff)
downloadPeerTube-67bf9b96bbcd92b069fe86d9223fe0f8b9c6e677.tar.gz
PeerTube-67bf9b96bbcd92b069fe86d9223fe0f8b9c6e677.tar.zst
PeerTube-67bf9b96bbcd92b069fe86d9223fe0f8b9c6e677.zip
Server: add database field validations
Diffstat (limited to 'server/models/oauth-client.js')
-rw-r--r--server/models/oauth-client.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/server/models/oauth-client.js b/server/models/oauth-client.js
index 15118591a..b56838d4c 100644
--- a/server/models/oauth-client.js
+++ b/server/models/oauth-client.js
@@ -1,11 +1,15 @@
1'use strict'
2
1module.exports = function (sequelize, DataTypes) { 3module.exports = function (sequelize, DataTypes) {
2 const OAuthClient = sequelize.define('OAuthClient', 4 const OAuthClient = sequelize.define('OAuthClient',
3 { 5 {
4 clientId: { 6 clientId: {
5 type: DataTypes.STRING 7 type: DataTypes.STRING,
8 allowNull: false
6 }, 9 },
7 clientSecret: { 10 clientSecret: {
8 type: DataTypes.STRING 11 type: DataTypes.STRING,
12 allowNull: false
9 }, 13 },
10 grants: { 14 grants: {
11 type: DataTypes.ARRAY(DataTypes.STRING) 15 type: DataTypes.ARRAY(DataTypes.STRING)
@@ -28,9 +32,6 @@ module.exports = function (sequelize, DataTypes) {
28 return OAuthClient 32 return OAuthClient
29} 33}
30 34
31// TODO: validation
32// OAuthClientSchema.path('clientSecret').required(true)
33
34// --------------------------------------------------------------------------- 35// ---------------------------------------------------------------------------
35 36
36function associate (models) { 37function associate (models) {