@stackfactor/client-api 1.1.96 → 1.1.98
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/lib/users.js +3 -1
- package/lib/utils.js +19 -15
- package/package.json +1 -1
package/lib/users.js
CHANGED
|
@@ -403,13 +403,15 @@ const login = (email, password) => {
|
|
|
403
403
|
/**
|
|
404
404
|
* Login callback after authentication to exchange the code token for authentication and refresh tokens
|
|
405
405
|
* @param {String} code
|
|
406
|
+
* @param {String} codeVerifier
|
|
406
407
|
* @param {String} redirectUri
|
|
407
408
|
* @returns {Promise}
|
|
408
409
|
*/
|
|
409
|
-
const loginExchangeKeys = (code, redirectUri) => {
|
|
410
|
+
const loginExchangeKeys = (code, codeVerifier, redirectUri) => {
|
|
410
411
|
return new Promise(function (resolve, reject) {
|
|
411
412
|
const requestData = {
|
|
412
413
|
code: code,
|
|
414
|
+
codeVerifier: codeVerifier,
|
|
413
415
|
redirectUri: redirectUri,
|
|
414
416
|
};
|
|
415
417
|
let request = client.post("api/v1/auth/loginexchangekeys", requestData);
|
package/lib/utils.js
CHANGED
|
@@ -19,21 +19,25 @@ const objectToArray = (data) => {
|
|
|
19
19
|
* @returns {String}
|
|
20
20
|
*/
|
|
21
21
|
const getBaseUrl = () => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
if (process.env.REACT_APP_BACKEND_URL) {
|
|
23
|
+
return process.env.REACT_APP_BACKEND_URL;
|
|
24
|
+
} else {
|
|
25
|
+
switch (process.env.REACT_APP_NODE_ENV) {
|
|
26
|
+
case "development":
|
|
27
|
+
case null:
|
|
28
|
+
case undefined:
|
|
29
|
+
return "https://localhost/";
|
|
30
|
+
case "testing":
|
|
31
|
+
return "https://qaapi.stackfactor.ai/";
|
|
32
|
+
case "nonprod":
|
|
33
|
+
return "https://apiqa.stackfactor.ai/";
|
|
34
|
+
case "production":
|
|
35
|
+
return "https://api.stackfactor.ai/";
|
|
36
|
+
case "security":
|
|
37
|
+
return "https://csapi.stackfactor.ai/";
|
|
38
|
+
default:
|
|
39
|
+
throw new Error("Invalid environment");
|
|
40
|
+
}
|
|
37
41
|
}
|
|
38
42
|
};
|
|
39
43
|
|