File tree 3 files changed +11
-3
lines changed
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
const mongoose = require ( 'mongoose' ) ;
2
2
const { isURL } = require ( 'validator' ) ;
3
3
const uniqueValidator = require ( 'mongoose-unique-validator' ) ;
4
+ const { ALLOWED_VIDEO_HOST_WHITELIST } = require ( '../utils/config' ) ;
4
5
5
6
const softwareSchema = new mongoose . Schema (
6
7
{
@@ -101,7 +102,7 @@ const softwareSchema = new mongoose.Schema(
101
102
if ( value ) {
102
103
return isURL ( value , {
103
104
protocols : [ 'http' , 'https' ] ,
104
- host_whitelist : [ 'youtube.com' , 'vimeo.com' ] ,
105
+ host_whitelist : ALLOWED_VIDEO_HOST_WHITELIST ,
105
106
} ) ;
106
107
}
107
108
return true ;
Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ POST http://localhost:3001/api/auth/login
2
2
Content-Type: application/json
3
3
4
4
{
5
- "email": "sample@example .com",
6
- "password": "SamplePassword "
5
+ "email": "lecamiv920@activesniper .com",
6
+ "password": "password "
7
7
}
Original file line number Diff line number Diff line change @@ -11,11 +11,18 @@ const MONGODB_URI = NODE_ENVIRONMENT === 'test'
11
11
12
12
const { FIREBASE_CLIENT_API_KEY } = process . env ;
13
13
const ALLOWED_USERNAME_REGEX = '^[a-z0-9_]+$' ;
14
+ const ALLOWED_VIDEO_HOST_WHITELIST = [
15
+ 'youtube.com' ,
16
+ 'vimeo.com' ,
17
+ 'www.youtube.com' ,
18
+ 'www.vimeo.com' ,
19
+ ] ;
14
20
15
21
module . exports = {
16
22
PORT ,
17
23
NODE_ENVIRONMENT ,
18
24
MONGODB_URI ,
19
25
ALLOWED_USERNAME_REGEX ,
20
26
FIREBASE_CLIENT_API_KEY ,
27
+ ALLOWED_VIDEO_HOST_WHITELIST
21
28
} ;
You can’t perform that action at this time.
0 commit comments