From 0323342499a0af66d93596d73df223d207a3b9c0 Mon Sep 17 00:00:00 2001 From: renat Date: Thu, 11 Nov 2021 23:02:17 +0400 Subject: [PATCH 1/3] fix: switch masters user id to userId --- src/utils/bypass/masters.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/bypass/masters.js b/src/utils/bypass/masters.js index 7840e1bbb..ff4afcd99 100644 --- a/src/utils/bypass/masters.js +++ b/src/utils/bypass/masters.js @@ -52,7 +52,7 @@ class MastersService { } static userId(userProfile) { - return userProfile.email; + return userProfile.userId; } async login(userProfile) { @@ -111,6 +111,7 @@ class MastersService { this.registerUser, userProfile ); + this.service.log.debug({ status, data }, 'masters ms-registration result'); if (status) { await contacts.add.call(this.service, { From 37338ff9f28624f514af87ac5641df9f58d6158c Mon Sep 17 00:00:00 2001 From: renat Date: Thu, 11 Nov 2021 23:48:06 +0400 Subject: [PATCH 2/3] fix: return email for debug --- src/utils/bypass/masters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/bypass/masters.js b/src/utils/bypass/masters.js index ff4afcd99..cd0ce55a9 100644 --- a/src/utils/bypass/masters.js +++ b/src/utils/bypass/masters.js @@ -52,7 +52,7 @@ class MastersService { } static userId(userProfile) { - return userProfile.userId; + return userProfile.email; } async login(userProfile) { From fcf92ef65dc5c67fcf2d895f0ecbe49c92a44c98 Mon Sep 17 00:00:00 2001 From: renat Date: Fri, 12 Nov 2021 09:48:39 +0400 Subject: [PATCH 3/3] fix: fix userid in bypass actions --- src/utils/bypass/masters.js | 3 +-- src/utils/bypass/pump-jack.js | 2 +- src/utils/contacts.js | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/bypass/masters.js b/src/utils/bypass/masters.js index cd0ce55a9..cbc31f880 100644 --- a/src/utils/bypass/masters.js +++ b/src/utils/bypass/masters.js @@ -111,12 +111,11 @@ class MastersService { this.registerUser, userProfile ); - this.service.log.debug({ status, data }, 'masters ms-registration result'); if (status) { await contacts.add.call(this.service, { contact: { type: 'email', value: userProfile.email }, - userId: data.id, + userId: data.user.id, }); return data; } diff --git a/src/utils/bypass/pump-jack.js b/src/utils/bypass/pump-jack.js index de53c9799..6d56a6c64 100644 --- a/src/utils/bypass/pump-jack.js +++ b/src/utils/bypass/pump-jack.js @@ -64,7 +64,7 @@ class PumpJackService { ); if (registeredUser) { - await contacts.add.call(this.service, { contact: { type: 'phone', value: userProfile.phone }, userId: registeredUser.id }); + await contacts.add.call(this.service, { contact: { type: 'phone', value: userProfile.phone }, userId: registeredUser.user.id }); return registeredUser; } diff --git a/src/utils/contacts.js b/src/utils/contacts.js index 98d958c0e..c840ba8de 100644 --- a/src/utils/contacts.js +++ b/src/utils/contacts.js @@ -34,6 +34,8 @@ async function checkLimit({ userId }) { } async function add({ userId, contact }) { + this.log.debug({ userId, contact }, 'add contact key params'); + const { redis } = this; const contactsCount = await checkLimit.call(this, { userId }); const lock = await this.dlock.once(lockContact(contact.value));