abmp-npm 1.1.67 → 1.1.69
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/backend/login/index.js
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const {
|
|
3
|
-
|
|
4
|
-
const createLoginMethods = generateSessionToken => {
|
|
5
|
-
//There is no generateSessionToken SDK version, and the signOn of @wix/identity returns 403 error regardless that the permissions are valid
|
|
6
|
-
//Therefore, as a workaround we need to inject the Velo version of generateSessionToken to the login methods.
|
|
7
|
-
const injectGenerateSessionTokenToMethod =
|
|
8
|
-
method =>
|
|
9
|
-
async (...args) =>
|
|
10
|
-
await method(...args, generateSessionToken);
|
|
11
|
-
return {
|
|
12
|
-
loginQAMember: injectGenerateSessionTokenToMethod(loginQAMember),
|
|
13
|
-
authenticateSSOToken: injectGenerateSessionTokenToMethod(authenticateSSOToken),
|
|
14
|
-
};
|
|
15
|
-
};
|
|
1
|
+
const { createLoginMethods } = require('./login-methods-factory');
|
|
2
|
+
const { validateMemberToken } = require('./sso-methods');
|
|
16
3
|
|
|
17
4
|
module.exports = {
|
|
18
5
|
createLoginMethods,
|
|
6
|
+
validateMemberToken,
|
|
19
7
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const { loginQAMember } = require('./qa-login-methods');
|
|
2
|
+
const { authenticateSSOToken } = require('./sso-methods');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Creates login methods with injected generateSessionToken dependency
|
|
6
|
+
* @param {Function} generateSessionToken - The Velo generateSessionToken function to inject
|
|
7
|
+
* @returns {Object} Object containing loginQAMember and authenticateSSOToken methods
|
|
8
|
+
*/
|
|
9
|
+
const createLoginMethods = generateSessionToken => {
|
|
10
|
+
//There is no generateSessionToken SDK version, and the signOn of @wix/identity returns 403 error regardless that the permissions are valid
|
|
11
|
+
//Therefore, as a workaround we need to inject the Velo version of generateSessionToken to the login methods.
|
|
12
|
+
const injectGenerateSessionTokenToMethod =
|
|
13
|
+
method =>
|
|
14
|
+
async (...args) =>
|
|
15
|
+
await method(...args, generateSessionToken);
|
|
16
|
+
return {
|
|
17
|
+
loginQAMember: injectGenerateSessionTokenToMethod(loginQAMember),
|
|
18
|
+
authenticateSSOToken: injectGenerateSessionTokenToMethod(authenticateSSOToken),
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
module.exports = {
|
|
23
|
+
createLoginMethods,
|
|
24
|
+
};
|
|
@@ -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));
|