diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-12-28 15:49:23 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-12-28 15:49:23 +0100 |
commit | 67bf9b96bbcd92b069fe86d9223fe0f8b9c6e677 (patch) | |
tree | bae6a9b0c3133c9cc38a2972222b5991f0cf614e /server/models/oauth-client.js | |
parent | 552cc9d646e78edae8b0fe61564d4e49db0b6206 (diff) | |
download | PeerTube-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.js | 11 |
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 | |||
1 | module.exports = function (sequelize, DataTypes) { | 3 | module.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 | ||
36 | function associate (models) { | 37 | function associate (models) { |