authscape 1.0.296 → 1.0.299
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 +14 -17
- package/package.json +1 -1
- package/src/components/AuthScapeApp.js +0 -2
- package/src/services/setupOEMProps.js +2 -2
package/index.js
CHANGED
|
@@ -23,8 +23,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
23
23
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
24
24
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
25
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
|
-
// import { apiService, setupOEMProps, OEMStyleSheet, AuthorizationComponent, authService, logEvent, init, signInValidator } from 'authscape';
|
|
27
|
-
|
|
28
26
|
function AuthScapeApp(_ref) {
|
|
29
27
|
var Component = _ref.Component,
|
|
30
28
|
pageProps = _ref.pageProps,
|
|
@@ -4276,22 +4274,21 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
|
4276
4274
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4277
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); }); }; }
|
|
4278
4276
|
var setupOEMProps = /*#__PURE__*/function () {
|
|
4279
|
-
var
|
|
4280
|
-
var
|
|
4277
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(apiUri, Component, ctx) {
|
|
4278
|
+
var pageProps, host, response;
|
|
4281
4279
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
4282
4280
|
while (1) switch (_context.prev = _context.next) {
|
|
4283
4281
|
case 0:
|
|
4284
|
-
Component = _ref.Component, ctx = _ref.ctx;
|
|
4285
4282
|
pageProps = {};
|
|
4286
4283
|
if (!Component.getInitialProps) {
|
|
4287
|
-
_context.next =
|
|
4284
|
+
_context.next = 5;
|
|
4288
4285
|
break;
|
|
4289
4286
|
}
|
|
4290
|
-
_context.next =
|
|
4287
|
+
_context.next = 4;
|
|
4291
4288
|
return Component.getInitialProps(ctx);
|
|
4292
|
-
case
|
|
4289
|
+
case 4:
|
|
4293
4290
|
pageProps = _context.sent;
|
|
4294
|
-
case
|
|
4291
|
+
case 5:
|
|
4295
4292
|
host = ctx.req.headers.host;
|
|
4296
4293
|
if (host.includes("localhost")) {
|
|
4297
4294
|
pageProps.host = "http://" + ctx.req.headers.host;
|
|
@@ -4300,27 +4297,27 @@ var setupOEMProps = /*#__PURE__*/function () {
|
|
|
4300
4297
|
}
|
|
4301
4298
|
|
|
4302
4299
|
// get the companyId
|
|
4303
|
-
_context.next =
|
|
4304
|
-
return apiService().get(
|
|
4305
|
-
case
|
|
4300
|
+
_context.next = 9;
|
|
4301
|
+
return apiService().get(apiUri + "/api/WhiteLabel/GetCompanyIdFromDomain?domain=" + pageProps.host);
|
|
4302
|
+
case 9:
|
|
4306
4303
|
response = _context.sent;
|
|
4307
4304
|
if (response != null && response.status == 200) {
|
|
4308
4305
|
pageProps.oemCompanyId = response.data;
|
|
4309
4306
|
}
|
|
4310
4307
|
return _context.abrupt("return", pageProps);
|
|
4311
|
-
case
|
|
4308
|
+
case 12:
|
|
4312
4309
|
case "end":
|
|
4313
4310
|
return _context.stop();
|
|
4314
4311
|
}
|
|
4315
4312
|
}, _callee);
|
|
4316
4313
|
}));
|
|
4317
|
-
return function setupOEMProps(_x) {
|
|
4318
|
-
return
|
|
4314
|
+
return function setupOEMProps(_x, _x2, _x3) {
|
|
4315
|
+
return _ref.apply(this, arguments);
|
|
4319
4316
|
};
|
|
4320
4317
|
}();
|
|
4321
4318
|
exports.setupOEMProps = setupOEMProps;
|
|
4322
|
-
function HeaderRecords(
|
|
4323
|
-
var pageProps =
|
|
4319
|
+
function HeaderRecords(_ref2) {
|
|
4320
|
+
var pageProps = _ref2.pageProps;
|
|
4324
4321
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, pageProps != null && pageProps.host != null && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("link", {
|
|
4325
4322
|
href: process.env.apiUri + "/api/WhiteLabel/GetDataFromRecord?domain=" + pageProps.host,
|
|
4326
4323
|
rel: "stylesheet"
|
package/package.json
CHANGED
|
@@ -6,8 +6,6 @@ import { useRouter } from 'next/router';
|
|
|
6
6
|
import { ThemeProvider } from '@mui/material/styles';
|
|
7
7
|
import { Box } from '@mui/material';
|
|
8
8
|
import Head from "next/head";
|
|
9
|
-
// import { apiService, setupOEMProps, OEMStyleSheet, AuthorizationComponent, authService, logEvent, init, signInValidator } from 'authscape';
|
|
10
|
-
|
|
11
9
|
|
|
12
10
|
export function AuthScapeApp({Component, pageProps, muiTheme = {}, enforceLoggedIn = false, enableAuth = true, onAuthenticationLoaded = null, children = null}) {
|
|
13
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState, useRef } from 'react';
|
|
2
2
|
|
|
3
|
-
export const setupOEMProps = async (
|
|
3
|
+
export const setupOEMProps = async (apiUri, Component, ctx) => {
|
|
4
4
|
|
|
5
5
|
let pageProps = {};
|
|
6
6
|
|
|
@@ -19,7 +19,7 @@ export const setupOEMProps = async ({Component, ctx}) => {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// get the companyId
|
|
22
|
-
let response = await apiService().get(
|
|
22
|
+
let response = await apiService().get(apiUri + "/api/WhiteLabel/GetCompanyIdFromDomain?domain=" + pageProps.host);
|
|
23
23
|
if (response != null && response.status == 200)
|
|
24
24
|
{
|
|
25
25
|
pageProps.oemCompanyId = response.data;
|