authscape 1.0.752 → 1.0.755
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 +7 -5
- package/package.json +1 -1
- package/src/components/AuthScapeApp.js +6 -5
package/index.js
CHANGED
|
@@ -15,8 +15,6 @@ var _router = _interopRequireDefault(require("next/router"));
|
|
|
15
15
|
var _ga4React = _interopRequireDefault(require("ga-4-react"));
|
|
16
16
|
var _zustand = require("zustand");
|
|
17
17
|
var _reactMicrosoftClarity = require("react-microsoft-clarity");
|
|
18
|
-
var _authService = require("../services/authService");
|
|
19
|
-
var _apiService = require("../services/apiService");
|
|
20
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
21
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
@@ -244,7 +242,9 @@ function AuthScapeApp(_ref) {
|
|
|
244
242
|
if (typeof window === "undefined") return;
|
|
245
243
|
if (pathName === "/signin-oidc") return;
|
|
246
244
|
var host = window.location.protocol + "//" + window.location.host;
|
|
247
|
-
|
|
245
|
+
|
|
246
|
+
// Use module.exports to access sibling exports in babel bundle
|
|
247
|
+
module.exports.apiService().post("/Analytics/PageView", {
|
|
248
248
|
userId: (_signedInUser$current = signedInUser.current) === null || _signedInUser$current === void 0 ? void 0 : _signedInUser$current.id,
|
|
249
249
|
locationId: (_signedInUser$current2 = signedInUser.current) === null || _signedInUser$current2 === void 0 ? void 0 : _signedInUser$current2.locationId,
|
|
250
250
|
companyId: (_signedInUser$current3 = signedInUser.current) === null || _signedInUser$current3 === void 0 ? void 0 : _signedInUser$current3.companyId,
|
|
@@ -262,7 +262,8 @@ function AuthScapeApp(_ref) {
|
|
|
262
262
|
if (!loadingAuth.current) {
|
|
263
263
|
loadingAuth.current = true;
|
|
264
264
|
if (enableAuth) {
|
|
265
|
-
|
|
265
|
+
// Use module.exports to access sibling exports in babel bundle
|
|
266
|
+
module.exports.apiService().GetCurrentUser().then(function (usr) {
|
|
266
267
|
signedInUser.current = ensureUserHelpers(usr);
|
|
267
268
|
setSignedInUserState(signedInUser.current);
|
|
268
269
|
setFrontEndLoadedState(true);
|
|
@@ -306,7 +307,8 @@ function AuthScapeApp(_ref) {
|
|
|
306
307
|
// ----- Enforce login (client) -----
|
|
307
308
|
(0, _react.useEffect)(function () {
|
|
308
309
|
if (enforceLoggedIn && pathname !== "/signin-oidc" && frontEndLoadedState && !signedInUserState) {
|
|
309
|
-
|
|
310
|
+
// Use module.exports to access sibling exports in babel bundle
|
|
311
|
+
module.exports.authService().login();
|
|
310
312
|
}
|
|
311
313
|
}, [signedInUserState, enforceLoggedIn, frontEndLoadedState, pathname]);
|
|
312
314
|
|
package/package.json
CHANGED
|
@@ -9,8 +9,6 @@ import Router from "next/router";
|
|
|
9
9
|
import GA4React from "ga-4-react";
|
|
10
10
|
import { create } from "zustand";
|
|
11
11
|
import { clarity } from "react-microsoft-clarity";
|
|
12
|
-
import { authService } from "../services/authService";
|
|
13
|
-
import { apiService } from "../services/apiService";
|
|
14
12
|
|
|
15
13
|
// ---- optional: import your cookie util if not global ----
|
|
16
14
|
// import { setCookie } from "cookies-next";
|
|
@@ -165,7 +163,8 @@ export function AuthScapeApp({
|
|
|
165
163
|
|
|
166
164
|
const host = window.location.protocol + "//" + window.location.host;
|
|
167
165
|
|
|
168
|
-
|
|
166
|
+
// Use module.exports to access sibling exports in babel bundle
|
|
167
|
+
module.exports.apiService().post("/Analytics/PageView", {
|
|
169
168
|
userId: signedInUser.current?.id,
|
|
170
169
|
locationId: signedInUser.current?.locationId,
|
|
171
170
|
companyId: signedInUser.current?.companyId,
|
|
@@ -185,7 +184,8 @@ export function AuthScapeApp({
|
|
|
185
184
|
loadingAuth.current = true;
|
|
186
185
|
|
|
187
186
|
if (enableAuth) {
|
|
188
|
-
|
|
187
|
+
// Use module.exports to access sibling exports in babel bundle
|
|
188
|
+
module.exports.apiService().GetCurrentUser().then((usr) => {
|
|
189
189
|
signedInUser.current = ensureUserHelpers(usr);
|
|
190
190
|
setSignedInUserState(signedInUser.current);
|
|
191
191
|
setFrontEndLoadedState(true);
|
|
@@ -235,7 +235,8 @@ export function AuthScapeApp({
|
|
|
235
235
|
frontEndLoadedState &&
|
|
236
236
|
!signedInUserState
|
|
237
237
|
) {
|
|
238
|
-
|
|
238
|
+
// Use module.exports to access sibling exports in babel bundle
|
|
239
|
+
module.exports.authService().login();
|
|
239
240
|
}
|
|
240
241
|
}, [signedInUserState, enforceLoggedIn, frontEndLoadedState, pathname]);
|
|
241
242
|
|