authscape 1.0.750 → 1.0.752
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 +5 -3
- package/package.json +1 -1
- package/src/components/AuthScapeApp.js +2 -0
package/index.js
CHANGED
|
@@ -15,6 +15,8 @@ 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");
|
|
18
20
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
19
21
|
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); }
|
|
20
22
|
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; }
|
|
@@ -242,7 +244,7 @@ function AuthScapeApp(_ref) {
|
|
|
242
244
|
if (typeof window === "undefined") return;
|
|
243
245
|
if (pathName === "/signin-oidc") return;
|
|
244
246
|
var host = window.location.protocol + "//" + window.location.host;
|
|
245
|
-
apiService().post("/Analytics/PageView", {
|
|
247
|
+
(0, _apiService.apiService)().post("/Analytics/PageView", {
|
|
246
248
|
userId: (_signedInUser$current = signedInUser.current) === null || _signedInUser$current === void 0 ? void 0 : _signedInUser$current.id,
|
|
247
249
|
locationId: (_signedInUser$current2 = signedInUser.current) === null || _signedInUser$current2 === void 0 ? void 0 : _signedInUser$current2.locationId,
|
|
248
250
|
companyId: (_signedInUser$current3 = signedInUser.current) === null || _signedInUser$current3 === void 0 ? void 0 : _signedInUser$current3.companyId,
|
|
@@ -260,7 +262,7 @@ function AuthScapeApp(_ref) {
|
|
|
260
262
|
if (!loadingAuth.current) {
|
|
261
263
|
loadingAuth.current = true;
|
|
262
264
|
if (enableAuth) {
|
|
263
|
-
apiService().GetCurrentUser().then(function (usr) {
|
|
265
|
+
(0, _apiService.apiService)().GetCurrentUser().then(function (usr) {
|
|
264
266
|
signedInUser.current = ensureUserHelpers(usr);
|
|
265
267
|
setSignedInUserState(signedInUser.current);
|
|
266
268
|
setFrontEndLoadedState(true);
|
|
@@ -304,7 +306,7 @@ function AuthScapeApp(_ref) {
|
|
|
304
306
|
// ----- Enforce login (client) -----
|
|
305
307
|
(0, _react.useEffect)(function () {
|
|
306
308
|
if (enforceLoggedIn && pathname !== "/signin-oidc" && frontEndLoadedState && !signedInUserState) {
|
|
307
|
-
authService().login();
|
|
309
|
+
(0, _authService.authService)().login();
|
|
308
310
|
}
|
|
309
311
|
}, [signedInUserState, enforceLoggedIn, frontEndLoadedState, pathname]);
|
|
310
312
|
|
package/package.json
CHANGED
|
@@ -9,6 +9,8 @@ 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";
|
|
12
14
|
|
|
13
15
|
// ---- optional: import your cookie util if not global ----
|
|
14
16
|
// import { setCookie } from "cookies-next";
|