abmp-npm 1.1.72 → 1.1.74
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.
|
@@ -3,11 +3,11 @@ const { getSecret } = require('../utils');
|
|
|
3
3
|
|
|
4
4
|
const validateQAUser = async userEmail => {
|
|
5
5
|
const qaUsers = await getQAUsers();
|
|
6
|
-
const
|
|
7
|
-
if (!
|
|
6
|
+
const matchingUserEmail = qaUsers.find(user => user.email === userEmail)?.email;
|
|
7
|
+
if (!matchingUserEmail) {
|
|
8
8
|
return { error: `Invalid user email: ${userEmail}` };
|
|
9
9
|
}
|
|
10
|
-
return { valid: true,
|
|
10
|
+
return { valid: true, email: matchingUserEmail };
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -30,7 +30,7 @@ const loginQAMember = async ({ userEmail, secret }, generateSessionToken) => {
|
|
|
30
30
|
return { success: false, error: 'Invalid secret' };
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
const token = await generateSessionToken(userValidation.
|
|
33
|
+
const token = await generateSessionToken(userValidation.email, qaSecret);
|
|
34
34
|
|
|
35
35
|
const result = await getMemberCMSId(userEmail);
|
|
36
36
|
if (!result.success) {
|
|
@@ -444,7 +444,7 @@ const getMemberByEmail = async email => {
|
|
|
444
444
|
const getQAUsers = async () => {
|
|
445
445
|
try {
|
|
446
446
|
return await wixData
|
|
447
|
-
.query(COLLECTIONS.
|
|
447
|
+
.query(COLLECTIONS.QA_USERS)
|
|
448
448
|
.include('member')
|
|
449
449
|
.find()
|
|
450
450
|
.then(res => res.items.map(item => item.member));
|
package/package.json
CHANGED
package/public/consts.js
CHANGED
|
@@ -12,7 +12,7 @@ const COLLECTIONS = {
|
|
|
12
12
|
INTERESTS: 'interests',
|
|
13
13
|
STATE_CITY_MAP: 'City',
|
|
14
14
|
UPDATED_LOGIN_EMAILS: 'updatedLoginEmails',
|
|
15
|
-
|
|
15
|
+
QA_USERS: 'QA_Users', //Make QA users configurable per site
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
/**
|