backend-manager 3.2.49 → 3.2.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -20,6 +20,7 @@ Module.prototype.main = function () {
|
|
|
20
20
|
// ⛔️⛔️⛔️ This function could be triggered when the user signs up with Google after already having a email/password account
|
|
21
21
|
// Get auth user from firebase
|
|
22
22
|
const authUser = await admin.auth().getUser(user.auth.uid).catch(e => e);
|
|
23
|
+
const requestData = payload.data.payload;
|
|
23
24
|
|
|
24
25
|
if (authUser instanceof Error) {
|
|
25
26
|
return reject(assistant.errorify(`Failed to get auth user: ${authUser}`, {code: 500}));
|
|
@@ -41,7 +42,7 @@ Module.prototype.main = function () {
|
|
|
41
42
|
// Create the user with the base data
|
|
42
43
|
const temporaryRecord = {
|
|
43
44
|
signupOptions: {
|
|
44
|
-
newsletter:
|
|
45
|
+
newsletter: requestData.newsletterSignUp || requestData.newsletter || false,
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
const userRecord = {
|
|
@@ -50,7 +51,7 @@ Module.prototype.main = function () {
|
|
|
50
51
|
client: assistant.request.client,
|
|
51
52
|
},
|
|
52
53
|
affiliate: {
|
|
53
|
-
referrer:
|
|
54
|
+
referrer: requestData.affiliateCode || requestData.affiliate || null,
|
|
54
55
|
},
|
|
55
56
|
auth: {
|
|
56
57
|
email: authUser.email,
|