authscape 1.0.654 → 1.0.656

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 CHANGED
@@ -12,7 +12,7 @@ var _head = _interopRequireDefault(require("next/head"));
12
12
  var _navigation = require("next/navigation");
13
13
  var _axios = _interopRequireDefault(require("axios"));
14
14
  var _queryString = _interopRequireDefault(require("query-string"));
15
- var _nookies = require("nookies");
15
+ var _jsCookie = _interopRequireDefault(require("js-cookie"));
16
16
  var _router = _interopRequireDefault(require("next/router"));
17
17
  var _ga4React = _interopRequireDefault(require("ga-4-react"));
18
18
  var _zustand = require("zustand");
@@ -85,7 +85,7 @@ function AuthScapeApp(_ref) {
85
85
  case 5:
86
86
  codeVerifier = window.localStorage.getItem("verifier");
87
87
  if (!(queryCode != null && codeVerifier != null)) {
88
- _context.next = 28;
88
+ _context.next = 25;
89
89
  break;
90
90
  }
91
91
  headers = {
@@ -108,30 +108,48 @@ function AuthScapeApp(_ref) {
108
108
  response = _context.sent;
109
109
  domainHost = window.location.hostname.split('.').slice(-2).join('.');
110
110
  window.localStorage.removeItem("verifier");
111
- _context.next = 17;
112
- return (0, _nookies.setCookie)(null, "access_token", response.data.access_token, {
111
+ _jsCookie["default"].set('access_token', response.data.access_token, {
113
112
  maxAge: 2147483647,
114
113
  path: '/',
115
114
  domain: domainHost,
116
115
  secure: true
117
116
  });
118
- case 17:
119
- _context.next = 19;
120
- return (0, _nookies.setCookie)(null, "expires_in", response.data.expires_in, {
117
+ _jsCookie["default"].set('expires_in', response.data.expires_in, {
121
118
  maxAge: 2147483647,
122
119
  path: '/',
123
120
  domain: domainHost,
124
121
  secure: true
125
122
  });
126
- case 19:
127
- _context.next = 21;
128
- return (0, _nookies.setCookie)(null, "refresh_token", response.data.refresh_token, {
123
+ _jsCookie["default"].set('refresh_token', response.data.refresh_token, {
129
124
  maxAge: 2147483647,
130
125
  path: '/',
131
126
  domain: domainHost,
132
127
  secure: true
133
128
  });
134
- case 21:
129
+
130
+ // await setCookie(null, "access_token", response.data.access_token,
131
+ // {
132
+ // maxAge: 2147483647,
133
+ // path: '/',
134
+ // domain: domainHost,
135
+ // secure: true
136
+ // });
137
+
138
+ // await setCookie(null, "expires_in", response.data.expires_in,
139
+ // {
140
+ // maxAge: 2147483647,
141
+ // path: '/',
142
+ // domain: domainHost,
143
+ // secure: true
144
+ // });
145
+
146
+ // await setCookie(null, "refresh_token", response.data.refresh_token,
147
+ // {
148
+ // maxAge: 2147483647,
149
+ // path: '/',
150
+ // domain: domainHost,
151
+ // secure: true
152
+ // });
135
153
  redirectUri = localStorage.getItem("redirectUri");
136
154
  localStorage.clear();
137
155
  if (redirectUri != null) {
@@ -139,16 +157,16 @@ function AuthScapeApp(_ref) {
139
157
  } else {
140
158
  window.location.href = "/";
141
159
  }
142
- _context.next = 28;
160
+ _context.next = 25;
143
161
  break;
144
- case 26:
145
- _context.prev = 26;
162
+ case 23:
163
+ _context.prev = 23;
146
164
  _context.t0 = _context["catch"](9);
147
- case 28:
165
+ case 25:
148
166
  case "end":
149
167
  return _context.stop();
150
168
  }
151
- }, _callee, null, [[9, 26]]);
169
+ }, _callee, null, [[9, 23]]);
152
170
  }));
153
171
  return function signInValidator(_x2) {
154
172
  return _ref2.apply(this, arguments);
@@ -2308,13 +2326,6 @@ var GoogleMapsHeatmap = function GoogleMapsHeatmap(_ref2) {
2308
2326
  data: element
2309
2327
  });
2310
2328
  });
2311
-
2312
- // const data = [
2313
- // { location: new google.maps.LatLng(35.6895, 139.6917), weight: 100 }, // Tokyo
2314
- // { location: new google.maps.LatLng(34.0522, -118.2437), weight: 200 }, // Los Angeles
2315
- // { location: new google.maps.LatLng(51.5074, -0.1278), weight: 500 }, // London
2316
- // // Add more data points as needed
2317
- // ];
2318
2329
  setHeatmapData(mappingData);
2319
2330
  }
2320
2331
  }, []);
@@ -8364,7 +8375,7 @@ exports.apiService = void 0;
8364
8375
  var _axios = _interopRequireDefault(require("axios"));
8365
8376
  var _queryString = _interopRequireDefault(require("query-string"));
8366
8377
  var _jsFileDownload = _interopRequireDefault(require("js-file-download"));
8367
- var _nookies = require("nookies");
8378
+ var _jsCookie = _interopRequireDefault(require("js-cookie"));
8368
8379
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8369
8380
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8370
8381
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -8386,7 +8397,7 @@ var setupDefaultOptions = /*#__PURE__*/function () {
8386
8397
  ctx = _args.length > 0 && _args[0] !== undefined ? _args[0] : null;
8387
8398
  defaultOptions = {};
8388
8399
  if (ctx == null) {
8389
- accessToken = (0, _nookies.parseCookies)().access_token || '';
8400
+ accessToken = _jsCookie["default"].get('access_token') || '';
8390
8401
  if (accessToken !== null && accessToken !== undefined && accessToken != "") {
8391
8402
  defaultOptions = {
8392
8403
  headers: {
@@ -8420,8 +8431,8 @@ var RefreshToken = /*#__PURE__*/function () {
8420
8431
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
8421
8432
  while (1) switch (_context2.prev = _context2.next) {
8422
8433
  case 0:
8423
- accessToken = (0, _nookies.parseCookies)().access_token || '';
8424
- refreshToken = (0, _nookies.parseCookies)().refresh_token || '';
8434
+ accessToken = _jsCookie["default"].get('access_token') || '';
8435
+ refreshToken = _jsCookie["default"].get('refresh_token') || '';
8425
8436
  _context2.next = 4;
8426
8437
  return instance.post(process.env.authorityUri + "/connect/token", _queryString["default"].stringify({
8427
8438
  grant_type: 'refresh_token',
@@ -8436,36 +8447,53 @@ var RefreshToken = /*#__PURE__*/function () {
8436
8447
  });
8437
8448
  case 4:
8438
8449
  response = _context2.sent;
8439
- if (!(response != null && response.status == 200)) {
8440
- _context2.next = 14;
8441
- break;
8450
+ if (response != null && response.status == 200) {
8451
+ domainHost = window.location.hostname.split('.').slice(-2).join('.');
8452
+ originalRequest.headers['Authorization'] = 'Bearer ' + response.data.access_token;
8453
+ _jsCookie["default"].set('access_token', response.data.access_token, {
8454
+ maxAge: 2147483647,
8455
+ path: '/',
8456
+ domain: domainHost,
8457
+ secure: true
8458
+ });
8459
+ _jsCookie["default"].set('expires_in', response.data.expires_in, {
8460
+ maxAge: 2147483647,
8461
+ path: '/',
8462
+ domain: domainHost,
8463
+ secure: true
8464
+ });
8465
+ _jsCookie["default"].set('refresh_token', response.data.refresh_token, {
8466
+ maxAge: 2147483647,
8467
+ path: '/',
8468
+ domain: domainHost,
8469
+ secure: true
8470
+ });
8471
+
8472
+ // await setCookie(null, "access_token", response.data.access_token,
8473
+ // {
8474
+ // maxAge: 2147483647,
8475
+ // path: '/',
8476
+ // domain: domainHost,
8477
+ // secure: true
8478
+ // });
8479
+
8480
+ // await setCookie(null, "expires_in", response.data.expires_in,
8481
+ // {
8482
+ // maxAge: 2147483647,
8483
+ // path: '/',
8484
+ // domain: domainHost,
8485
+ // secure: true
8486
+ // });
8487
+
8488
+ // await setCookie(null, "refresh_token", response.data.refresh_token,
8489
+ // {
8490
+ // maxAge: 2147483647,
8491
+ // path: '/',
8492
+ // domain: domainHost,
8493
+ // secure: true
8494
+ // });
8442
8495
  }
8443
- domainHost = window.location.hostname.split('.').slice(-2).join('.');
8444
- originalRequest.headers['Authorization'] = 'Bearer ' + response.data.access_token;
8445
- _context2.next = 10;
8446
- return (0, _nookies.setCookie)(null, "access_token", response.data.access_token, {
8447
- maxAge: 2147483647,
8448
- path: '/',
8449
- domain: domainHost,
8450
- secure: true
8451
- });
8452
- case 10:
8453
- _context2.next = 12;
8454
- return (0, _nookies.setCookie)(null, "expires_in", response.data.expires_in, {
8455
- maxAge: 2147483647,
8456
- path: '/',
8457
- domain: domainHost,
8458
- secure: true
8459
- });
8460
- case 12:
8461
- _context2.next = 14;
8462
- return (0, _nookies.setCookie)(null, "refresh_token", response.data.refresh_token, {
8463
- maxAge: 2147483647,
8464
- path: '/',
8465
- domain: domainHost,
8466
- secure: true
8467
- });
8468
- case 14:
8496
+ case 6:
8469
8497
  case "end":
8470
8498
  return _context2.stop();
8471
8499
  }
@@ -8523,21 +8551,36 @@ var apiService = function apiService() {
8523
8551
  // remove the access and refresh if invalid
8524
8552
  {
8525
8553
  domainHost = window.location.hostname.split('.').slice(-2).join('.');
8526
- (0, _nookies.destroyCookie)(null, "access_token", {
8527
- maxAge: 2147483647,
8554
+ _jsCookie["default"].remove('access_token', {
8528
8555
  path: '/',
8529
8556
  domain: domainHost
8530
8557
  });
8531
- (0, _nookies.destroyCookie)(null, "refresh_token", {
8532
- maxAge: 2147483647,
8558
+ _jsCookie["default"].remove('refresh_token', {
8533
8559
  path: '/',
8534
8560
  domain: domainHost
8535
8561
  });
8536
- (0, _nookies.destroyCookie)(null, "expires_in", {
8537
- maxAge: 2147483647,
8562
+ _jsCookie["default"].remove('expires_in', {
8538
8563
  path: '/',
8539
8564
  domain: domainHost
8540
8565
  });
8566
+
8567
+ // destroyCookie(null, "access_token", {
8568
+ // maxAge: 2147483647,
8569
+ // path: '/',
8570
+ // domain: domainHost
8571
+ // });
8572
+
8573
+ // destroyCookie(null, "refresh_token", {
8574
+ // maxAge: 2147483647,
8575
+ // path: '/',
8576
+ // domain: domainHost
8577
+ // });
8578
+
8579
+ // destroyCookie(null, "expires_in", {
8580
+ // maxAge: 2147483647,
8581
+ // path: '/',
8582
+ // domain: domainHost
8583
+ // });
8541
8584
  }
8542
8585
  return _context3.abrupt("return", Promise.reject(error));
8543
8586
  case 10:
@@ -8692,7 +8735,7 @@ var apiService = function apiService() {
8692
8735
  while (1) switch (_context8.prev = _context8.next) {
8693
8736
  case 0:
8694
8737
  _context8.prev = 0;
8695
- accessToken = (0, _nookies.parseCookies)().access_token || null;
8738
+ accessToken = _jsCookie["default"].get('access_token') || null;
8696
8739
  if (!accessToken) {
8697
8740
  _context8.next = 11;
8698
8741
  break;
@@ -8892,7 +8935,7 @@ Object.defineProperty(exports, "__esModule", {
8892
8935
  });
8893
8936
  exports.authService = void 0;
8894
8937
  var _react = _interopRequireDefault(require("react"));
8895
- var _nookies = require("nookies");
8938
+ var _jsCookie = _interopRequireDefault(require("js-cookie"));
8896
8939
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8897
8940
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
8898
8941
  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); } }
@@ -9085,21 +9128,37 @@ var authService = function authService() {
9085
9128
  redirectUri = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : null;
9086
9129
  domainHost = window.location.hostname.split('.').slice(-2).join('.');
9087
9130
  AuthUri = process.env.authorityUri;
9088
- (0, _nookies.destroyCookie)({}, "access_token", {
9089
- maxAge: 2147483647,
9131
+ _jsCookie["default"].remove('access_token', {
9090
9132
  path: '/',
9091
9133
  domain: domainHost
9092
9134
  });
9093
- (0, _nookies.destroyCookie)({}, "refresh_token", {
9094
- maxAge: 2147483647,
9135
+ _jsCookie["default"].remove('refresh_token', {
9095
9136
  path: '/',
9096
9137
  domain: domainHost
9097
9138
  });
9098
- (0, _nookies.destroyCookie)({}, "expires_in", {
9099
- maxAge: 2147483647,
9139
+ _jsCookie["default"].remove('expires_in', {
9100
9140
  path: '/',
9101
9141
  domain: domainHost
9102
9142
  });
9143
+
9144
+ // destroyCookie({}, "access_token", {
9145
+ // maxAge: 2147483647,
9146
+ // path: '/',
9147
+ // domain: domainHost
9148
+ // });
9149
+
9150
+ // destroyCookie({}, "refresh_token", {
9151
+ // maxAge: 2147483647,
9152
+ // path: '/',
9153
+ // domain: domainHost
9154
+ // });
9155
+
9156
+ // destroyCookie({}, "expires_in", {
9157
+ // maxAge: 2147483647,
9158
+ // path: '/',
9159
+ // domain: domainHost
9160
+ // });
9161
+
9103
9162
  setTimeout(function () {
9104
9163
  if (redirectUri == null) {
9105
9164
  window.location.href = AuthUri + "/connect/logout?redirect=" + window.location.href;
@@ -9203,7 +9262,7 @@ exports.signInValidator = void 0;
9203
9262
  var _react = _interopRequireWildcard(require("react"));
9204
9263
  var _axios = _interopRequireDefault(require("axios"));
9205
9264
  var _queryString = _interopRequireDefault(require("query-string"));
9206
- var _nookies = require("nookies");
9265
+ var _jsCookie = _interopRequireDefault(require("js-cookie"));
9207
9266
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9208
9267
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
9209
9268
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -9218,7 +9277,7 @@ var signInValidator = /*#__PURE__*/function () {
9218
9277
  case 0:
9219
9278
  codeVerifier = window.localStorage.getItem("verifier");
9220
9279
  if (!(queryCode != null && codeVerifier != null)) {
9221
- _context.next = 18;
9280
+ _context.next = 15;
9222
9281
  break;
9223
9282
  }
9224
9283
  headers = {
@@ -9240,30 +9299,48 @@ var signInValidator = /*#__PURE__*/function () {
9240
9299
  response = _context.sent;
9241
9300
  domainHost = window.location.hostname.split('.').slice(-2).join('.');
9242
9301
  window.localStorage.removeItem("verifier");
9243
- _context.next = 11;
9244
- return (0, _nookies.setCookie)(null, "access_token", response.data.access_token, {
9302
+ _jsCookie["default"].set('access_token', response.data.access_token, {
9245
9303
  maxAge: 2147483647,
9246
9304
  path: '/',
9247
9305
  domain: domainHost,
9248
9306
  secure: true
9249
9307
  });
9250
- case 11:
9251
- _context.next = 13;
9252
- return (0, _nookies.setCookie)(null, "expires_in", response.data.expires_in, {
9308
+ _jsCookie["default"].set('expires_in', response.data.expires_in, {
9253
9309
  maxAge: 2147483647,
9254
9310
  path: '/',
9255
9311
  domain: domainHost,
9256
9312
  secure: true
9257
9313
  });
9258
- case 13:
9259
- _context.next = 15;
9260
- return (0, _nookies.setCookie)(null, "refresh_token", response.data.refresh_token, {
9314
+ _jsCookie["default"].set('refresh_token', response.data.refresh_token, {
9261
9315
  maxAge: 2147483647,
9262
9316
  path: '/',
9263
9317
  domain: domainHost,
9264
9318
  secure: true
9265
9319
  });
9266
- case 15:
9320
+
9321
+ // await setCookie(null, "access_token", response.data.access_token,
9322
+ // {
9323
+ // maxAge: 2147483647,
9324
+ // path: '/',
9325
+ // domain: domainHost,
9326
+ // secure: true
9327
+ // });
9328
+
9329
+ // await setCookie(null, "expires_in", response.data.expires_in,
9330
+ // {
9331
+ // maxAge: 2147483647,
9332
+ // path: '/',
9333
+ // domain: domainHost,
9334
+ // secure: true
9335
+ // });
9336
+
9337
+ // await setCookie(null, "refresh_token", response.data.refresh_token,
9338
+ // {
9339
+ // maxAge: 2147483647,
9340
+ // path: '/',
9341
+ // domain: domainHost,
9342
+ // secure: true
9343
+ // });
9267
9344
  redirectUri = localStorage.getItem("redirectUri");
9268
9345
  localStorage.clear();
9269
9346
  if (redirectUri != null) {
@@ -9271,7 +9348,7 @@ var signInValidator = /*#__PURE__*/function () {
9271
9348
  } else {
9272
9349
  window.location.href = "/";
9273
9350
  }
9274
- case 18:
9351
+ case 15:
9275
9352
  case "end":
9276
9353
  return _context.stop();
9277
9354
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.654",
3
+ "version": "1.0.656",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -11,7 +11,6 @@
11
11
  "license": "ISC",
12
12
  "peerDependencies": {
13
13
  "js-file-download": "^0.4.12",
14
- "nookies": "^2.5.2",
15
14
  "react-data-table-component": "^7.5.2",
16
15
  "react-dom": "^18.2.0"
17
16
  },
@@ -23,17 +22,17 @@
23
22
  "react-dom": "^18.2.0"
24
23
  },
25
24
  "dependencies": {
26
- "@emotion/react": "^11.11.3",
27
- "@emotion/styled": "^11.11.0",
28
25
  "@microsoft/signalr": "^8.0.0",
26
+ "audit": "^0.0.6",
29
27
  "axios": "^1.6.1",
30
28
  "eslint-config-next": "^14.1.0",
29
+ "fix": "^0.0.3",
31
30
  "ga-4-react": "^0.1.281",
32
31
  "html2canvas": "^1.4.1",
32
+ "js-cookie": "^3.0.5",
33
33
  "js-file-download": "^0.4.12",
34
34
  "jspdf": "^2.5.1",
35
35
  "next": "^14.1.0",
36
- "nookies": "^2.5.2",
37
36
  "query-string": "^7.1.1",
38
37
  "react": "^18.2.0",
39
38
  "react-color": "^2.19.3",
@@ -5,7 +5,7 @@ import Head from "next/head";
5
5
  import { useSearchParams, usePathname } from 'next/navigation';
6
6
  import axios from 'axios';
7
7
  import querystring from "query-string";
8
- import { setCookie } from 'nookies';
8
+ import Cookies from 'js-cookie';
9
9
  import Router from 'next/router';
10
10
  import GA4React from 'ga-4-react';
11
11
  import { create } from 'zustand'
@@ -69,29 +69,50 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
69
69
  let domainHost = window.location.hostname.split('.').slice(-2).join('.');
70
70
  window.localStorage.removeItem("verifier");
71
71
 
72
- await setCookie(null, "access_token", response.data.access_token,
73
- {
72
+ Cookies.set('access_token', response.data.access_token, {
74
73
  maxAge: 2147483647,
75
74
  path: '/',
76
75
  domain: domainHost,
77
76
  secure: true
78
77
  });
79
-
80
- await setCookie(null, "expires_in", response.data.expires_in,
81
- {
78
+
79
+ Cookies.set('expires_in', response.data.expires_in, {
82
80
  maxAge: 2147483647,
83
81
  path: '/',
84
82
  domain: domainHost,
85
83
  secure: true
86
84
  });
87
-
88
- await setCookie(null, "refresh_token", response.data.refresh_token,
89
- {
85
+
86
+ Cookies.set('refresh_token', response.data.refresh_token, {
90
87
  maxAge: 2147483647,
91
88
  path: '/',
92
89
  domain: domainHost,
93
90
  secure: true
94
91
  });
92
+
93
+ // await setCookie(null, "access_token", response.data.access_token,
94
+ // {
95
+ // maxAge: 2147483647,
96
+ // path: '/',
97
+ // domain: domainHost,
98
+ // secure: true
99
+ // });
100
+
101
+ // await setCookie(null, "expires_in", response.data.expires_in,
102
+ // {
103
+ // maxAge: 2147483647,
104
+ // path: '/',
105
+ // domain: domainHost,
106
+ // secure: true
107
+ // });
108
+
109
+ // await setCookie(null, "refresh_token", response.data.refresh_token,
110
+ // {
111
+ // maxAge: 2147483647,
112
+ // path: '/',
113
+ // domain: domainHost,
114
+ // secure: true
115
+ // });
95
116
 
96
117
 
97
118
  let redirectUri = localStorage.getItem("redirectUri")
@@ -41,13 +41,6 @@ export const GoogleMapsHeatmap = ({apiKey, data = [], gradient = null, radius =
41
41
  data.forEach(element => {
42
42
  mappingData.push({ location: new google.maps.LatLng(element.lat, element.lng), weight: element.weight, data: element });
43
43
  });
44
-
45
- // const data = [
46
- // { location: new google.maps.LatLng(35.6895, 139.6917), weight: 100 }, // Tokyo
47
- // { location: new google.maps.LatLng(34.0522, -118.2437), weight: 200 }, // Los Angeles
48
- // { location: new google.maps.LatLng(51.5074, -0.1278), weight: 500 }, // London
49
- // // Add more data points as needed
50
- // ];
51
44
  setHeatmapData(mappingData);
52
45
 
53
46
  }
@@ -1,14 +1,14 @@
1
1
  import axios from 'axios'
2
2
  import querystring from 'query-string';
3
3
  import fileDownload from 'js-file-download';
4
- import { parseCookies, setCookie, destroyCookie } from 'nookies';
4
+ import Cookies from 'js-cookie';
5
5
 
6
6
  const setupDefaultOptions = async (ctx = null) => {
7
7
 
8
8
  let defaultOptions = {};
9
9
  if (ctx == null)
10
10
  {
11
- let accessToken = parseCookies().access_token || '';
11
+ let accessToken = Cookies.get('access_token') || '';
12
12
 
13
13
  if (accessToken !== null && accessToken !== undefined && accessToken != "") {
14
14
  defaultOptions = {
@@ -37,8 +37,8 @@ const setupDefaultOptions = async (ctx = null) => {
37
37
 
38
38
  const RefreshToken = async (originalRequest, instance) => {
39
39
 
40
- let accessToken = parseCookies().access_token || '';
41
- let refreshToken = parseCookies().refresh_token || '';
40
+ let accessToken = Cookies.get('access_token') || '';
41
+ let refreshToken = Cookies.get('refresh_token') || '';
42
42
 
43
43
  let response = await instance.post(process.env.authorityUri + "/connect/token",
44
44
  querystring.stringify({
@@ -58,29 +58,56 @@ const RefreshToken = async (originalRequest, instance) => {
58
58
  let domainHost = window.location.hostname.split('.').slice(-2).join('.');
59
59
  originalRequest.headers['Authorization'] = 'Bearer ' + response.data.access_token;
60
60
 
61
- await setCookie(null, "access_token", response.data.access_token,
62
- {
61
+
62
+
63
+
64
+
65
+ Cookies.set('access_token', response.data.access_token, {
63
66
  maxAge: 2147483647,
64
67
  path: '/',
65
68
  domain: domainHost,
66
69
  secure: true
67
70
  });
68
-
69
- await setCookie(null, "expires_in", response.data.expires_in,
70
- {
71
+
72
+ Cookies.set('expires_in', response.data.expires_in, {
71
73
  maxAge: 2147483647,
72
74
  path: '/',
73
75
  domain: domainHost,
74
76
  secure: true
75
77
  });
76
-
77
- await setCookie(null, "refresh_token", response.data.refresh_token,
78
- {
78
+
79
+ Cookies.set('refresh_token', response.data.refresh_token, {
79
80
  maxAge: 2147483647,
80
81
  path: '/',
81
82
  domain: domainHost,
82
83
  secure: true
83
84
  });
85
+
86
+
87
+
88
+ // await setCookie(null, "access_token", response.data.access_token,
89
+ // {
90
+ // maxAge: 2147483647,
91
+ // path: '/',
92
+ // domain: domainHost,
93
+ // secure: true
94
+ // });
95
+
96
+ // await setCookie(null, "expires_in", response.data.expires_in,
97
+ // {
98
+ // maxAge: 2147483647,
99
+ // path: '/',
100
+ // domain: domainHost,
101
+ // secure: true
102
+ // });
103
+
104
+ // await setCookie(null, "refresh_token", response.data.refresh_token,
105
+ // {
106
+ // maxAge: 2147483647,
107
+ // path: '/',
108
+ // domain: domainHost,
109
+ // secure: true
110
+ // });
84
111
  }
85
112
  }
86
113
 
@@ -126,23 +153,28 @@ export const apiService = (ctx = null) => {
126
153
  {
127
154
  let domainHost = window.location.hostname.split('.').slice(-2).join('.');
128
155
 
129
- destroyCookie(null, "access_token", {
130
- maxAge: 2147483647,
131
- path: '/',
132
- domain: domainHost
133
- });
134
-
135
- destroyCookie(null, "refresh_token", {
136
- maxAge: 2147483647,
137
- path: '/',
138
- domain: domainHost
139
- });
140
-
141
- destroyCookie(null, "expires_in", {
142
- maxAge: 2147483647,
143
- path: '/',
144
- domain: domainHost
145
- });
156
+
157
+ Cookies.remove('access_token', { path: '/', domain: domainHost });
158
+ Cookies.remove('refresh_token', { path: '/', domain: domainHost });
159
+ Cookies.remove('expires_in', { path: '/', domain: domainHost });
160
+
161
+ // destroyCookie(null, "access_token", {
162
+ // maxAge: 2147483647,
163
+ // path: '/',
164
+ // domain: domainHost
165
+ // });
166
+
167
+ // destroyCookie(null, "refresh_token", {
168
+ // maxAge: 2147483647,
169
+ // path: '/',
170
+ // domain: domainHost
171
+ // });
172
+
173
+ // destroyCookie(null, "expires_in", {
174
+ // maxAge: 2147483647,
175
+ // path: '/',
176
+ // domain: domainHost
177
+ // });
146
178
  }
147
179
 
148
180
  return Promise.reject(error);
@@ -207,7 +239,7 @@ export const apiService = (ctx = null) => {
207
239
 
208
240
  try
209
241
  {
210
- let accessToken = parseCookies().access_token || null;
242
+ let accessToken = Cookies.get('access_token') || null;
211
243
 
212
244
  if (accessToken)
213
245
  {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { destroyCookie } from 'nookies';
2
+ import Cookies from 'js-cookie';
3
3
 
4
4
  export const authService = () => {
5
5
 
@@ -115,23 +115,30 @@ export const authService = () => {
115
115
 
116
116
  let domainHost = window.location.hostname.split('.').slice(-2).join('.');
117
117
  let AuthUri = process.env.authorityUri;
118
- destroyCookie({}, "access_token", {
119
- maxAge: 2147483647,
120
- path: '/',
121
- domain: domainHost
122
- });
123
-
124
- destroyCookie({}, "refresh_token", {
125
- maxAge: 2147483647,
126
- path: '/',
127
- domain: domainHost
128
- });
129
-
130
- destroyCookie({}, "expires_in", {
131
- maxAge: 2147483647,
132
- path: '/',
133
- domain: domainHost
134
- });
118
+
119
+
120
+ Cookies.remove('access_token', { path: '/', domain: domainHost });
121
+ Cookies.remove('refresh_token', { path: '/', domain: domainHost });
122
+ Cookies.remove('expires_in', { path: '/', domain: domainHost });
123
+
124
+
125
+ // destroyCookie({}, "access_token", {
126
+ // maxAge: 2147483647,
127
+ // path: '/',
128
+ // domain: domainHost
129
+ // });
130
+
131
+ // destroyCookie({}, "refresh_token", {
132
+ // maxAge: 2147483647,
133
+ // path: '/',
134
+ // domain: domainHost
135
+ // });
136
+
137
+ // destroyCookie({}, "expires_in", {
138
+ // maxAge: 2147483647,
139
+ // path: '/',
140
+ // domain: domainHost
141
+ // });
135
142
 
136
143
  setTimeout(() => {
137
144
  if (redirectUri == null)
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import axios from 'axios';
3
3
  import querystring from "query-string";
4
- import { setCookie } from 'nookies';
4
+ import Cookies from 'js-cookie';
5
5
 
6
6
  export const signInValidator = async (queryCode) => {
7
7
 
@@ -26,31 +26,55 @@ export const signInValidator = async (queryCode) => {
26
26
  let domainHost = window.location.hostname.split('.').slice(-2).join('.');
27
27
  window.localStorage.removeItem("verifier");
28
28
 
29
- await setCookie(null, "access_token", response.data.access_token,
30
- {
29
+
30
+
31
+ Cookies.set('access_token', response.data.access_token, {
31
32
  maxAge: 2147483647,
32
33
  path: '/',
33
34
  domain: domainHost,
34
35
  secure: true
35
36
  });
36
-
37
- await setCookie(null, "expires_in", response.data.expires_in,
38
- {
37
+
38
+ Cookies.set('expires_in', response.data.expires_in, {
39
39
  maxAge: 2147483647,
40
40
  path: '/',
41
41
  domain: domainHost,
42
42
  secure: true
43
43
  });
44
-
45
- await setCookie(null, "refresh_token", response.data.refresh_token,
46
- {
47
- maxAge: 2147483647,
48
- path: '/',
49
- domain: domainHost,
50
- secure: true
44
+
45
+ Cookies.set('refresh_token', response.data.refresh_token, {
46
+ maxAge: 2147483647,
47
+ path: '/',
48
+ domain: domainHost,
49
+ secure: true
51
50
  });
52
51
 
53
52
 
53
+ // await setCookie(null, "access_token", response.data.access_token,
54
+ // {
55
+ // maxAge: 2147483647,
56
+ // path: '/',
57
+ // domain: domainHost,
58
+ // secure: true
59
+ // });
60
+
61
+ // await setCookie(null, "expires_in", response.data.expires_in,
62
+ // {
63
+ // maxAge: 2147483647,
64
+ // path: '/',
65
+ // domain: domainHost,
66
+ // secure: true
67
+ // });
68
+
69
+ // await setCookie(null, "refresh_token", response.data.refresh_token,
70
+ // {
71
+ // maxAge: 2147483647,
72
+ // path: '/',
73
+ // domain: domainHost,
74
+ // secure: true
75
+ // });
76
+
77
+
54
78
  let redirectUri = localStorage.getItem("redirectUri")
55
79
  localStorage.clear();
56
80
  if (redirectUri != null)