Sfoglia il codice sorgente

:construction: small changes necessary for working email auth

juan_spike
juancarbajal98 2 anni fa
parent
commit
136c72d0fc

+ 1
- 1
backend/lib/routes/user/getsession.js Vedi File

20
         tags: ['api'],
20
         tags: ['api'],
21
         auth: false,
21
         auth: false,
22
         cors: {
22
         cors: {
23
-            headers: ['Authorization'],
23
+            headers: ['Authorization', 'Content-Type'],
24
             exposedHeaders: ['Authorization', 'Access-Control-Expose-Headers'],
24
             exposedHeaders: ['Authorization', 'Access-Control-Expose-Headers'],
25
         },
25
         },
26
         handler: async function (request, h) {
26
         handler: async function (request, h) {

+ 1
- 1
backend/lib/routes/user/validatesession.js Vedi File

21
         tags: ['api'],
21
         tags: ['api'],
22
         auth: false,
22
         auth: false,
23
         cors: {
23
         cors: {
24
-            headers: ['Authorization'],
24
+            headers: ['Authorization', 'Content-Type'],
25
             exposedHeaders: ['Authorization', 'Access-Control-Expose-Headers'],
25
             exposedHeaders: ['Authorization', 'Access-Control-Expose-Headers'],
26
         },
26
         },
27
         handler: async function (request, h) {
27
         handler: async function (request, h) {

+ 1
- 1
backend/lib/services/user.js Vedi File

361
                     email: userCredentials.email,
361
                     email: userCredentials.email,
362
                 },
362
                 },
363
             ],
363
             ],
364
-            templateId: 1,
364
+            templateId: 2,
365
             params: {
365
             params: {
366
                 // TODO: Change this in production...
366
                 // TODO: Change this in production...
367
                 link: `localhost:3000/verify/${hashedSessionToken}`,
367
                 link: `localhost:3000/verify/${hashedSessionToken}`,

+ 2
- 1
frontend/src/entities/survey/survey.answer.validator.js Vedi File

10
     // TODO: change to valdate against JWT??
10
     // TODO: change to valdate against JWT??
11
     auth: Joi.any(),
11
     auth: Joi.any(),
12
 
12
 
13
-    password: Joi.string().min(10).max(30).pattern(new RegExp('[a-zA-Z0-9]+')),
13
+    // password: Joi.string().min(10).max(30).pattern(new RegExp('[a-zA-Z0-9]+')),
14
+    password: Joi.string().max(30).pattern(new RegExp('[a-zA-Z0-9]+')),
14
     // TODO: Change if going international (only works in usa)
15
     // TODO: Change if going international (only works in usa)
15
     zipcode: Joi.string().min(5).max(5).pattern(new RegExp('^[0-9]{5}$')),
16
     zipcode: Joi.string().min(5).max(5).pattern(new RegExp('^[0-9]{5}$')),
16
     seeking: Joi.string(),
17
     seeking: Joi.string(),

+ 0
- 4
frontend/src/entities/survey/survey.js Vedi File

37
         /**  Fields */
37
         /**  Fields */
38
         this.steps = [...questionSteps] // ! required
38
         this.steps = [...questionSteps] // ! required
39
         this.aspectQuestions = _formatAspectQuestions(this.steps)
39
         this.aspectQuestions = _formatAspectQuestions(this.steps)
40
-        console.log(
41
-            'this.aspectQuestions: ',
42
-            JSON.stringify(this.aspectQuestions),
43
-        )
44
     }
40
     }
45
 
41
 
46
     hasMinResponsesToCreateProfile(responses) {
42
     hasMinResponsesToCreateProfile(responses) {

Loading…
Annulla
Salva