authscape 1.0.300 → 1.0.304
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/index.js +10 -9
- package/package.json +1 -1
- package/src/services/setupOEMProps.js +3 -6
package/index.js
CHANGED
|
@@ -4275,11 +4275,11 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
4275
4275
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
4276
4276
|
var setupOEMProps = /*#__PURE__*/function () {
|
|
4277
4277
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
4278
|
-
var Component, ctx, pageProps, host, response;
|
|
4278
|
+
var Component, ctx, apiUrl, pageProps, host, response;
|
|
4279
4279
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4280
4280
|
while (1) switch (_context.prev = _context.next) {
|
|
4281
4281
|
case 0:
|
|
4282
|
-
Component = _ref.Component, ctx = _ref.ctx;
|
|
4282
|
+
Component = _ref.Component, ctx = _ref.ctx, apiUrl = _ref.apiUrl;
|
|
4283
4283
|
pageProps = {};
|
|
4284
4284
|
if (!Component.getInitialProps) {
|
|
4285
4285
|
_context.next = 6;
|
|
@@ -4291,7 +4291,7 @@ var setupOEMProps = /*#__PURE__*/function () {
|
|
|
4291
4291
|
pageProps = _context.sent;
|
|
4292
4292
|
case 6:
|
|
4293
4293
|
if (!(ctx.req != null)) {
|
|
4294
|
-
_context.next =
|
|
4294
|
+
_context.next = 15;
|
|
4295
4295
|
break;
|
|
4296
4296
|
}
|
|
4297
4297
|
host = ctx.req.headers.host;
|
|
@@ -4303,15 +4303,16 @@ var setupOEMProps = /*#__PURE__*/function () {
|
|
|
4303
4303
|
|
|
4304
4304
|
// get the companyId
|
|
4305
4305
|
_context.next = 11;
|
|
4306
|
-
return
|
|
4306
|
+
return fetch(apiUrl + "/api/WhiteLabel/GetCompanyIdFromDomain?domain=" + pageProps.host);
|
|
4307
4307
|
case 11:
|
|
4308
4308
|
response = _context.sent;
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
}
|
|
4312
|
-
case 13:
|
|
4313
|
-
return _context.abrupt("return", pageProps);
|
|
4309
|
+
_context.next = 14;
|
|
4310
|
+
return response.json();
|
|
4314
4311
|
case 14:
|
|
4312
|
+
pageProps.oemCompanyId = _context.sent;
|
|
4313
|
+
case 15:
|
|
4314
|
+
return _context.abrupt("return", pageProps);
|
|
4315
|
+
case 16:
|
|
4315
4316
|
case "end":
|
|
4316
4317
|
return _context.stop();
|
|
4317
4318
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from 'react';
|
|
2
2
|
|
|
3
|
-
export const setupOEMProps = async ({Component, ctx}) => {
|
|
3
|
+
export const setupOEMProps = async ({Component, ctx, apiUrl}) => {
|
|
4
4
|
|
|
5
5
|
let pageProps = {};
|
|
6
6
|
|
|
@@ -21,11 +21,8 @@ export const setupOEMProps = async ({Component, ctx}) => {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// get the companyId
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
pageProps.oemCompanyId = response.data;
|
|
28
|
-
}
|
|
24
|
+
const response = await fetch(apiUrl + "/api/WhiteLabel/GetCompanyIdFromDomain?domain=" + pageProps.host);
|
|
25
|
+
pageProps.oemCompanyId = await response.json();
|
|
29
26
|
}
|
|
30
27
|
|
|
31
28
|
return pageProps;
|