Ver código fonte

:recycle: lock-down every route

jwt
j 3 anos atrás
pai
commit
a5ed5322fd

+ 1
- 0
backend/lib/auth/strategies/jwt.js Ver arquivo

@@ -10,6 +10,7 @@ module.exports = options => {
10 10
             aud: 'urn:audience:test',
11 11
             iss: 'urn:issuer:test',
12 12
             sub: false,
13
+            maxAgeSec: 14400, // 4 hours
13 14
         },
14 15
         validate: (artifacts, request, h) => {
15 16
             try {

+ 20
- 15
backend/lib/routes/health/get.js Ver arquivo

@@ -8,47 +8,52 @@ const pluginConfig = {
8 8
     handlerType: 'health',
9 9
     docs: {
10 10
         description: 'Get server stats',
11
-        notes: 'Returns stats on server status'
12
-    }
11
+        notes: 'Returns stats on server status',
12
+    },
13
+    opts: {
14
+        tags: ['api'],
15
+        auth: { strategy: 'default_jwt' },
16
+        cors: true,
17
+    },
13 18
 }
14 19
 
15 20
 const validators = {}
16 21
 
17 22
 const responseSchemas = {
18 23
     health: healthSchema.stats,
19
-    error: errorSchema.single
24
+    error: errorSchema.single,
20 25
 }
21 26
 
22 27
 module.exports = {
23 28
     method: 'GET',
24 29
     path: '/',
25
-    options:{
30
+    options: {
26 31
         ...pluginConfig.docs,
27
-        tags: ['api'],
28
-        auth: false,
29
-        cors: true,
32
+        ...pluginConfig.opts,
30 33
         handler: async function (request, h) {
31 34
             const { healthService } = request.server.services()
32 35
             const stats = await healthService.getStats()
33 36
             try {
34
-                return h.response(({
35
-                    ok:true,
36
-                    handler: pluginConfig.handlerType,
37
-                    data: stats
38
-                })).code(200)
37
+                return h
38
+                    .response({
39
+                        ok: true,
40
+                        handler: pluginConfig.handlerType,
41
+                        data: stats,
42
+                    })
43
+                    .code(200)
39 44
             } catch (err) {
40 45
                 return h
41 46
                     .response({
42 47
                         ok: false,
43 48
                         handler: pluginConfig.handlerType,
44
-                        data: {error: `${err}`}
49
+                        data: { error: `${err}` },
45 50
                     })
46 51
                     .code(409)
47 52
             }
48 53
         },
49 54
         validate: {
50 55
             ...validators,
51
-            failAction: 'log'
56
+            failAction: 'log',
52 57
         },
53 58
 
54 59
         response: {
@@ -66,4 +71,4 @@ module.exports = {
66 71
             },
67 72
         },
68 73
     },
69
-}
74
+}

+ 6
- 4
backend/lib/routes/membership/active.js Ver arquivo

@@ -12,6 +12,11 @@ const pluginConfig = {
12 12
         description: 'active memberships',
13 13
         notes: 'A list of groupings with active membership',
14 14
     },
15
+    opts: {
16
+        tags: ['api'],
17
+        auth: { strategy: 'default_jwt' },
18
+        cors: true,
19
+    },
15 20
 }
16 21
 
17 22
 const validators = {
@@ -57,10 +62,7 @@ module.exports = {
57 62
     path: '/{profile_id}',
58 63
     options: {
59 64
         ...pluginConfig.docs,
60
-        tags: ['api'],
61
-        /** Protect this route with authentication? */
62
-        auth: false,
63
-        cors: true,
65
+        ...pluginConfig.opts,
64 66
         handler: async function (request, h) {
65 67
             const { membershipService, profileService } =
66 68
                 request.server.services()

+ 6
- 3
backend/lib/routes/membership/join.js Ver arquivo

@@ -11,6 +11,11 @@ const pluginConfig = {
11 11
         description: 'join',
12 12
         notes: 'Join a grouping by creating a membership record',
13 13
     },
14
+    opts: {
15
+        tags: ['api'],
16
+        auth: { strategy: 'default_jwt' },
17
+        cors: true,
18
+    },
14 19
 }
15 20
 
16 21
 const validators = {
@@ -37,9 +42,7 @@ module.exports = {
37 42
     path: '/{profile_id}/join',
38 43
     options: {
39 44
         ...pluginConfig.docs,
40
-        tags: ['api'],
41
-        auth: false,
42
-        cors: true,
45
+        ...pluginConfig.opts,
43 46
 
44 47
         /**
45 48
          * Join a grouping by creating a membership record

+ 6
- 2
backend/lib/routes/membership/leave.js Ver arquivo

@@ -8,6 +8,11 @@ const pluginConfig = {
8 8
         description: 'leave',
9 9
         notes: 'Leave a grouping by editing a membership record',
10 10
     },
11
+    opts: {
12
+        tags: ['api'],
13
+        auth: { strategy: 'default_jwt' },
14
+        cors: true,
15
+    },
11 16
 }
12 17
 
13 18
 const validators = {
@@ -21,8 +26,7 @@ module.exports = {
21 26
     path: '/leave',
22 27
     options: {
23 28
         ...pluginConfig.docs,
24
-        tags: ['api'],
25
-        auth: false,
29
+        ...pluginConfig.opts,
26 30
         handler: async function (request, h) {
27 31
             try {
28 32
                 return {

+ 7
- 3
backend/lib/routes/membership/reveal.js Ver arquivo

@@ -9,6 +9,11 @@ const pluginConfig = {
9 9
         description: 'reveal',
10 10
         notes: 'Reveal profile information to a grouping by membership',
11 11
     },
12
+    opts: {
13
+        tags: ['api'],
14
+        auth: { strategy: 'default_jwt' },
15
+        cors: true,
16
+    },
12 17
 }
13 18
 
14 19
 const validators = {
@@ -22,14 +27,13 @@ const responseSchemas = {
22 27
     }),
23 28
     error: errorSchema.single,
24 29
 }
30
+
25 31
 module.exports = {
26 32
     method: 'POST',
27 33
     path: '/{grouping_id}/reveal',
28 34
     options: {
29 35
         ...pluginConfig.docs,
30
-        tags: ['api'],
31
-        auth: false,
32
-        cors: true,
36
+        ...pluginConfig.opts,
33 37
         handler: async function (request, h) {
34 38
             const { membershipService, profileService } =
35 39
                 request.server.services()

+ 6
- 6
backend/lib/routes/notification/index.js Ver arquivo

@@ -1,6 +1,3 @@
1
-const Joi = require('joi')
2
-const apiSchema = require('../../schemas/api')
3
-const errorSchema = require('../../schemas/errors')
4 1
 const params = require('../../schemas/params')
5 2
 
6 3
 const pluginConfig = {
@@ -9,6 +6,11 @@ const pluginConfig = {
9 6
         description: 'subscribe',
10 7
         notes: 'Subscribe to notifications based on profile_id',
11 8
     },
9
+    opts: {
10
+        tags: ['api'],
11
+        auth: { strategy: 'default_jwt' },
12
+        cors: true,
13
+    },
12 14
 }
13 15
 
14 16
 const validators = {
@@ -20,9 +22,7 @@ module.exports = {
20 22
     path: '/{profile_id}/subscribe',
21 23
     options: {
22 24
         ...pluginConfig.docs,
23
-        tags: ['api'],
24
-        auth: false,
25
-        cors: true,
25
+        ...pluginConfig.opts,
26 26
         handler: async (request, h) => {
27 27
             const { profile_id } = request.params
28 28
 

+ 6
- 4
backend/lib/routes/profile/get.js Ver arquivo

@@ -11,6 +11,11 @@ const pluginConfig = {
11 11
         description: 'Returns a single profile with tags',
12 12
         notes: 'returns from the Profiles Table',
13 13
     },
14
+    opts: {
15
+        tags: ['api'],
16
+        auth: { strategy: 'default_jwt' },
17
+        cors: true,
18
+    },
14 19
 }
15 20
 
16 21
 const responseSchemas = {
@@ -27,10 +32,7 @@ module.exports = {
27 32
     path: '/{profile_id}',
28 33
     options: {
29 34
         ...pluginConfig.docs,
30
-        tags: ['api'],
31
-        /** Protect this route with authentication? */
32
-        auth: false,
33
-        cors: true,
35
+        ...pluginConfig.opts,
34 36
         handler: async function (request, h) {
35 37
             const { profile_id } = request.params
36 38
             const { profileService } = request.server.services()

+ 6
- 3
backend/lib/routes/profile/match.js Ver arquivo

@@ -10,6 +10,11 @@ const pluginConfig = {
10 10
         description: 'matches',
11 11
         notes: 'Match everyone',
12 12
     },
13
+    opts: {
14
+        tags: ['api'],
15
+        auth: { strategy: 'default_jwt' },
16
+        cors: true,
17
+    },
13 18
 }
14 19
 
15 20
 const validators = {}
@@ -24,9 +29,7 @@ module.exports = {
24 29
     path: '/match',
25 30
     options: {
26 31
         ...pluginConfig.docs,
27
-        tags: ['api'],
28
-        /** Protect this route with authentication? */
29
-        auth: false,
32
+        ...pluginConfig.opts,
30 33
 
31 34
         handler: async function (request, h) {
32 35
             const { matchService, matchQueueService } =

+ 6
- 4
backend/lib/routes/profile/patch-queue.js Ver arquivo

@@ -12,6 +12,11 @@ const pluginConfig = {
12 12
         description: 'Updates match queue in place',
13 13
         notes: 'Updates in place and does not delete from table',
14 14
     },
15
+    opts: {
16
+        tags: ['api'],
17
+        auth: { strategy: 'default_jwt' },
18
+        cors: true,
19
+    },
15 20
 }
16 21
 
17 22
 const responseSchemas = {
@@ -34,10 +39,7 @@ module.exports = {
34 39
     path: '/{profile_id}/queue/{target_id}/delete',
35 40
     options: {
36 41
         ...pluginConfig.docs,
37
-        tags: ['api'],
38
-        /** Protect this route with authentication? */
39
-        auth: false,
40
-        cors: true,
42
+        ...pluginConfig.opts,
41 43
         handler: async function (request, h) {
42 44
             const { profile_id, target_id } = request.params
43 45
             const { include_profile, reinsert } = request.query

+ 6
- 4
backend/lib/routes/profile/queue.js Ver arquivo

@@ -12,6 +12,11 @@ const pluginConfig = {
12 12
         description: 'Returns previously scored profiles',
13 13
         notes: 'returns from the MatchQueue Table',
14 14
     },
15
+    opts: {
16
+        tags: ['api'],
17
+        auth: { strategy: 'default_jwt' },
18
+        cors: true,
19
+    },
15 20
 }
16 21
 
17 22
 const responseSchemas = {
@@ -31,10 +36,7 @@ module.exports = {
31 36
     path: '/{profile_id}/queue',
32 37
     options: {
33 38
         ...pluginConfig.docs,
34
-        tags: ['api'],
35
-        /** Protect this route with authentication? */
36
-        auth: false,
37
-        cors: true,
39
+        ...pluginConfig.opts,
38 40
         handler: async function (request, h) {
39 41
             const { profile_id } = request.params
40 42
             const { include_profile } = request.query

+ 6
- 4
backend/lib/routes/profile/respond.js Ver arquivo

@@ -12,6 +12,11 @@ const pluginConfig = {
12 12
         description: 'Update profile',
13 13
         notes: 'Update profile responses',
14 14
     },
15
+    opts: {
16
+        tags: ['api'],
17
+        auth: { strategy: 'default_jwt' },
18
+        cors: true,
19
+    },
15 20
 }
16 21
 
17 22
 const responseSchemas = {
@@ -40,10 +45,7 @@ module.exports = {
40 45
     path: '/{profile_id}/respond',
41 46
     options: {
42 47
         ...pluginConfig.docs,
43
-        tags: ['api'],
44
-        /** Protect this route with authentication? */
45
-        auth: false,
46
-        cors: true,
48
+        ...pluginConfig.opts,
47 49
         handler: async function (request, h) {
48 50
             const { profileService } = request.services()
49 51
 

+ 6
- 4
backend/lib/routes/profile/score.js Ver arquivo

@@ -12,6 +12,11 @@ const pluginConfig = {
12 12
         description: 'scores',
13 13
         notes: 'A list of profile scores',
14 14
     },
15
+    opts: {
16
+        tags: ['api'],
17
+        auth: { strategy: 'default_jwt' },
18
+        cors: true,
19
+    },
15 20
 }
16 21
 
17 22
 const validators = {
@@ -40,10 +45,7 @@ module.exports = {
40 45
     path: '/{profile_id}/score',
41 46
     options: {
42 47
         ...pluginConfig.docs,
43
-        tags: ['api'],
44
-        /** Protect this route with authentication? */
45
-        auth: false,
46
-        cors: true,
48
+        ...pluginConfig.opts,
47 49
         handler: async function (request, h) {
48 50
             const { profileService, matchQueueService } =
49 51
                 request.server.services()

+ 6
- 4
backend/lib/routes/profile/update.js Ver arquivo

@@ -12,6 +12,11 @@ const pluginConfig = {
12 12
         description: 'Update profile',
13 13
         notes: 'Update profile responses',
14 14
     },
15
+    opts: {
16
+        tags: ['api'],
17
+        auth: { strategy: 'default_jwt' },
18
+        cors: true,
19
+    },
15 20
 }
16 21
 
17 22
 const responseSchemas = {
@@ -37,10 +42,7 @@ module.exports = {
37 42
     path: '/{profile_id}/update/{response_id?}',
38 43
     options: {
39 44
         ...pluginConfig.docs,
40
-        tags: ['api'],
41
-        /** Protect this route with authentication? */
42
-        auth: false,
43
-
45
+        ...pluginConfig.opts,
44 46
         handler: async function (request, h) {
45 47
             const { profileService } = request.services()
46 48
             const profileId = request.params.profile_id

+ 6
- 4
backend/lib/routes/survey/questions.js Ver arquivo

@@ -10,6 +10,11 @@ const pluginConfig = {
10 10
         description: 'Get survey questions',
11 11
         notes: 'Returns a list of all possible survey questions in the form of response_keys',
12 12
     },
13
+    opts: {
14
+        tags: ['api'],
15
+        auth: false,
16
+        cors: true,
17
+    },
13 18
 }
14 19
 
15 20
 /** Validator functions by request method */
@@ -32,10 +37,7 @@ module.exports = {
32 37
     path: '/questions',
33 38
     options: {
34 39
         ...pluginConfig.docs,
35
-        tags: ['api'],
36
-        /** Protect this route with authentication? */
37
-        auth: false,
38
-        cors: true,
40
+        ...pluginConfig.opts,
39 41
         handler: async function (request, h) {
40 42
             const { responseService } = request.services()
41 43
             const responseKeys = await responseService.getResponseKeys()

+ 6
- 3
backend/lib/routes/survey/responses.js Ver arquivo

@@ -11,6 +11,11 @@ const pluginConfig = {
11 11
         description: 'Get responses to questions',
12 12
         notes: 'Returns a list of all survey responses for a user',
13 13
     },
14
+    opts: {
15
+        tags: ['api'],
16
+        auth: { strategy: 'default_jwt' },
17
+        cors: true,
18
+    },
14 19
 }
15 20
 
16 21
 /** Validator functions by request method */
@@ -33,9 +38,7 @@ module.exports = {
33 38
     path: '/questions',
34 39
     options: {
35 40
         ...pluginConfig.docs,
36
-        tags: ['api'],
37
-        /** Protect this route with authentication? */
38
-        auth: false,
41
+        ...pluginConfig.opts,
39 42
 
40 43
         handler: async function (request, h) {
41 44
             const { responseService } = request.services()

+ 6
- 4
backend/lib/routes/tag/get.js Ver arquivo

@@ -11,6 +11,11 @@ const pluginConfig = {
11 11
         description: 'Get tags based on membership id',
12 12
         notes: 'returns from the Tag Associations Table',
13 13
     },
14
+    opts: {
15
+        tags: ['api'],
16
+        auth: { strategy: 'default_jwt' },
17
+        cors: true,
18
+    },
14 19
 }
15 20
 
16 21
 const responseSchemas = {
@@ -31,10 +36,7 @@ module.exports = {
31 36
     path: '/{profile_id}/tags/{grouping_id}',
32 37
     options: {
33 38
         ...pluginConfig.docs,
34
-        tags: ['api'],
35
-        /** Protect this route with authentication? */
36
-        auth: false,
37
-        cors: true,
39
+        ...pluginConfig.opts,
38 40
         handler: async function (request, h) {
39 41
             const { grouping_id, profile_id } = request.params
40 42
             const { profileService } = request.server.services()

+ 7
- 4
backend/lib/routes/tag/reveal.js Ver arquivo

@@ -11,6 +11,11 @@ const pluginConfig = {
11 11
         description: 'Reveals part of a profile based on tag',
12 12
         notes: 'returns from the Tag Associations Table',
13 13
     },
14
+    opts: {
15
+        tags: ['api'],
16
+        auth: { strategy: 'default_jwt' },
17
+        cors: true,
18
+    },
14 19
 }
15 20
 
16 21
 const responseSchemas = {
@@ -31,10 +36,8 @@ module.exports = {
31 36
     path: '/{profile_id}/reveal/{tag_id}',
32 37
     options: {
33 38
         ...pluginConfig.docs,
34
-        tags: ['api'],
35
-        /** Protect this route with authentication? */
36
-        auth: false,
37
-        cors: true,
39
+        ...pluginConfig.opts,
40
+
38 41
         handler: async function (request, h) {
39 42
             const { profile_id, tag_id } = request.params
40 43
             const { profileService } = request.server.services()

+ 7
- 5
backend/lib/routes/user/authentication.js Ver arquivo

@@ -11,12 +11,17 @@ const pluginConfig = {
11 11
             notes: 'Returns a password by the user email passed in the path',
12 12
         },
13 13
     },
14
+    opts: {
15
+        tags: ['api'],
16
+        auth: { strategy: 'default_jwt' },
17
+        cors: true,
18
+    },
14 19
 }
15 20
 
16 21
 /** Validator functions by request method */
17 22
 const validators = {
18 23
     /** Validate the route params (/active/{thing}) */
19
-    params: params.userEmail
24
+    params: params.userEmail,
20 25
 }
21 26
 
22 27
 module.exports = {
@@ -24,10 +29,7 @@ module.exports = {
24 29
     path: '/{user_email}/password',
25 30
     options: {
26 31
         ...pluginConfig.docs.get,
27
-        tags: ['api'],
28
-        // auth: 'default_jwt',
29
-        auth: false,
30
-        cors: true,
32
+        ...pluginConfig.opts,
31 33
         handler: async function (request, h) {
32 34
             try {
33 35
                 const { userService } = request.services()

+ 6
- 4
backend/lib/routes/user/create-profile.js Ver arquivo

@@ -10,6 +10,11 @@ const pluginConfig = {
10 10
         description: 'Create profile for user',
11 11
         notes: 'Create a profile associated with this user',
12 12
     },
13
+    opts: {
14
+        tags: ['api'],
15
+        auth: { strategy: 'default_jwt' },
16
+        cors: true,
17
+    },
13 18
 }
14 19
 
15 20
 const validators = {
@@ -44,10 +49,7 @@ module.exports = {
44 49
     path: '/{user_id}/profile',
45 50
     options: {
46 51
         ...pluginConfig.docs,
47
-        tags: ['api'],
48
-        /** Protect this route with authentication? */
49
-        auth: false,
50
-        cors: true,
52
+        ...pluginConfig.opts,
51 53
         handler: async function (request, h) {
52 54
             const { userService, profileService } = request.server.services()
53 55
             const userId = request.params.user_id

+ 6
- 2
backend/lib/routes/user/current.js Ver arquivo

@@ -11,6 +11,11 @@ const pluginConfig = {
11 11
             notes: 'Returns a user item by the id passed in the path',
12 12
         },
13 13
     },
14
+    opts: {
15
+        tags: ['api'],
16
+        auth: { strategy: 'default_jwt' },
17
+        cors: true,
18
+    },
14 19
 }
15 20
 
16 21
 /** Validator functions by request method */
@@ -25,8 +30,7 @@ module.exports = {
25 30
     path: '/{name}',
26 31
     options: {
27 32
         ...pluginConfig.docs.get,
28
-        tags: ['api'],
29
-        auth: 'default_jwt',
33
+        ...pluginConfig.opts,
30 34
         handler: async function (request, h) {
31 35
             try {
32 36
                 const auth = {

+ 6
- 4
backend/lib/routes/user/list-profiles.js Ver arquivo

@@ -11,6 +11,11 @@ const pluginConfig = {
11 11
         description: 'profiles',
12 12
         notes: 'A list of profiles associated with this user',
13 13
     },
14
+    opts: {
15
+        tags: ['api'],
16
+        auth: { strategy: 'default_jwt' },
17
+        cors: true,
18
+    },
14 19
 }
15 20
 
16 21
 const validators = {
@@ -36,10 +41,7 @@ module.exports = {
36 41
     path: '/{user_id}/profiles',
37 42
     options: {
38 43
         ...pluginConfig.docs,
39
-        tags: ['api'],
40
-        /** Protect this route with authentication? */
41
-        auth: false,
42
-        cors: true,
44
+        ...pluginConfig.opts,
43 45
         handler: async function (request, h) {
44 46
             const { userService, profileService } = request.server.services()
45 47
             const userId = request.params.user_id

+ 6
- 3
backend/lib/routes/user/login.js Ver arquivo

@@ -10,6 +10,11 @@ const pluginConfig = {
10 10
         description: 'login',
11 11
         notes: 'Attempt login',
12 12
     },
13
+    opts: {
14
+        tags: ['api'],
15
+        auth: false,
16
+        cors: true,
17
+    },
13 18
 }
14 19
 
15 20
 /** Validator functions by request method */
@@ -19,7 +24,6 @@ const validators = {
19 24
             user_email: Joi.string(),
20 25
             password: Joi.string(),
21 26
         }),
22
-        
23 27
     },
24 28
     user: userSchema.single,
25 29
     error: errorSchema.single,
@@ -30,8 +34,7 @@ module.exports = {
30 34
     path: '/login',
31 35
     options: {
32 36
         ...pluginConfig.docs,
33
-        tags: ['api'],
34
-        auth: false,
37
+        ...pluginConfig.opts,
35 38
         handler: async function (request, h) {
36 39
             try {
37 40
                 const { userService } = request.services()

+ 8
- 5
backend/lib/routes/user/signup.js Ver arquivo

@@ -10,6 +10,11 @@ const pluginConfig = {
10 10
         description: 'Create a user',
11 11
         notes: 'Create a user and other things',
12 12
     },
13
+    opts: {
14
+        tags: ['api'],
15
+        auth: false,
16
+        cors: true,
17
+    },
13 18
 }
14 19
 
15 20
 const validators = {
@@ -35,10 +40,8 @@ module.exports = {
35 40
     path: '/signup',
36 41
     options: {
37 42
         ...pluginConfig.docs,
38
-        tags: ['api'],
39
-        /** Protect this route with authentication? */
40
-        auth: false,
41
-        cors: true,
43
+        ...pluginConfig.opts,
44
+
42 45
         handler: async function (request, h) {
43 46
             const { userService } = request.server.services()
44 47
             const res = request.payload
@@ -56,7 +59,7 @@ module.exports = {
56 59
                         is_admin: 0,
57 60
                         is_verified: 0,
58 61
                     },
59
-                    created_at: Date.now()
62
+                    created_at: Date.now(),
60 63
                 })
61 64
                 return h
62 65
                     .response({

+ 1
- 31
backend/lib/services/user.js Ver arquivo

@@ -5,36 +5,6 @@ const Jwt = require('@hapi/jwt')
5 5
 const Schmervice = require('@hapipal/schmervice')
6 6
 const SecurePassword = require('secure-password')
7 7
 
8
-const hasher = async (pwd, steak) => {
9
-    const hash = await pwd.hash(steak)
10
-    const result = await pwd.verify(steak, hash)
11
-    let squirtle = null
12
-
13
-    switch (result) {
14
-        case SecurePassword.INVALID_UNRECOGNIZED_HASH:
15
-            return console.error(
16
-                'This hash was not made with secure-password. Attempt legacy algorithm',
17
-            )
18
-        case SecurePassword.INVALID:
19
-            return console.log('Invalid password')
20
-        case SecurePassword.VALID:
21
-            return result
22
-        case SecurePassword.VALID_NEEDS_REHASH:
23
-            console.log('Yay you made it, wait for us to improve your safety')
24
-            try {
25
-                squirtle = await pwd.hash(steak)
26
-                // console.log('improvedHash', squirtle)
27
-                // const saveHash = Auth.insert({user_email: matchingEmails}, ).into('token')
28
-                return squirtle
29
-            } catch (err) {
30
-                console.error(
31
-                    'You are authenticated, but we could not improve your safety this time around',
32
-                )
33
-            }
34
-            break
35
-    }
36
-}
37
-
38 8
 /** Class for methods used in the User plugin */
39 9
 module.exports = class UserService extends Schmervice.Service {
40 10
     /**
@@ -185,7 +155,7 @@ module.exports = class UserService extends Schmervice.Service {
185 155
                 algorithm: 'HS256',
186 156
             },
187 157
             {
188
-                ttlSec: 4 * 60 * 60, // 7 days
158
+                ttlSec: 14400, // 4 hours
189 159
             },
190 160
         )
191 161
     }

Carregando…
Cancelar
Salvar