Procházet zdrojové kódy

:bug: Fixed verification errors

juan-filtering-match-pool
tomit4 před 2 roky
rodič
revize
a2f9031222

+ 3
- 2
backend/lib/routes/profile/queue.js Zobrazit soubor

4
 const apiSchema = require('../../schemas/api')
4
 const apiSchema = require('../../schemas/api')
5
 const errorSchema = require('../../schemas/errors')
5
 const errorSchema = require('../../schemas/errors')
6
 const profileSchema = require('../../schemas/profiles')
6
 const profileSchema = require('../../schemas/profiles')
7
-const params = require('../../schemas/params')
8
 
7
 
9
 const pluginConfig = {
8
 const pluginConfig = {
10
     handlerType: 'profile',
9
     handlerType: 'profile',
22
 }
21
 }
23
 
22
 
24
 const validators = {
23
 const validators = {
25
-    params: params.profileId,
24
+    params: Joi.object({
25
+        profile_id: Joi.string(),
26
+    }),
26
     query: Joi.object({
27
     query: Joi.object({
27
         include_profile: Joi.bool(),
28
         include_profile: Joi.bool(),
28
         limit: Joi.number(),
29
         limit: Joi.number(),

+ 2
- 3
backend/lib/routes/tag/get.js Zobrazit soubor

2
 
2
 
3
 const apiSchema = require('../../schemas/api')
3
 const apiSchema = require('../../schemas/api')
4
 const errorSchema = require('../../schemas/errors')
4
 const errorSchema = require('../../schemas/errors')
5
-const params = require('../../schemas/params')
6
 const Joi = require('joi')
5
 const Joi = require('joi')
7
 
6
 
8
 const pluginConfig = {
7
 const pluginConfig = {
20
 
19
 
21
 const validators = {
20
 const validators = {
22
     params: Joi.object({
21
     params: Joi.object({
23
-        profile_id: params.profileId,
24
-        grouping_id: params.groupingId,
22
+        profile_id: Joi.string(),
23
+        grouping_id: Joi.string(),
25
     }),
24
     }),
26
     query: Joi.object({ category: Joi.string() }),
25
     query: Joi.object({ category: Joi.string() }),
27
 }
26
 }

+ 7
- 0
backend/lib/routes/user/verify-session.js Zobrazit soubor

12
     },
12
     },
13
 }
13
 }
14
 
14
 
15
+const validators = {
16
+    params: Joi.object({
17
+        hashedSessionToken: Joi.string(),
18
+    }),
19
+}
20
+
15
 module.exports = {
21
 module.exports = {
16
     method: 'GET',
22
     method: 'GET',
17
     path: '/verify/{hashedSessionToken}',
23
     path: '/verify/{hashedSessionToken}',
69
             }
75
             }
70
         },
76
         },
71
         validate: {
77
         validate: {
78
+            ...validators,
72
             failAction: 'log',
79
             failAction: 'log',
73
         },
80
         },
74
         response: {
81
         response: {

+ 1
- 2
frontend/src/services/auth.service.js Zobrazit soubor

36
         const hashedAccessToken = this.grabStoredCookie(sessionCookie)
36
         const hashedAccessToken = this.grabStoredCookie(sessionCookie)
37
         if (!hashedAccessToken)
37
         if (!hashedAccessToken)
38
             return console.warn('WARNING :=> accessToken is not defined')
38
             return console.warn('WARNING :=> accessToken is not defined')
39
-        const validatedToken =
40
-            await authenticator.validateSession(hashedAccessToken)
39
+        const validatedToken = await this.validateSession(hashedAccessToken)
41
         if (validatedToken.error) {
40
         if (validatedToken.error) {
42
             console.error('ERROR :=>', validatedToken.error)
41
             console.error('ERROR :=>', validatedToken.error)
43
         } else {
42
         } else {

+ 0
- 5
frontend/src/views/OnboardingView.vue Zobrazit soubor

58
             const sessionData =
58
             const sessionData =
59
                 await authenticator.verifySessionCookie('siimee_session')
59
                 await authenticator.verifySessionCookie('siimee_session')
60
             if (sessionData) {
60
             if (sessionData) {
61
-                await currentProfile.login(
62
-                    sessionData.profileId,
63
-                    this.$waveui.notify,
64
-                    sessionData.sessionToken,
65
-                )
66
                 this.responses = this.formatResponses(
61
                 this.responses = this.formatResponses(
67
                     currentProfile._profile.responses,
62
                     currentProfile._profile.responses,
68
                 )
63
                 )

Načítá se…
Zrušit
Uložit