@opengeoweb/authentication 12.10.0 → 12.12.0
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.esm.js +243 -307
- package/package.json +7 -4
- package/src/index.d.ts +0 -1
- package/src/lib/components/UserMenuRoles/UserMenuRolesConnect.stories.d.ts +1 -1
- package/src/lib/components/PrivateRoute/RequireAuth.d.ts +0 -6
- package/src/lib/components/PrivateRoute/RequireAuth.spec.d.ts +0 -1
- package/src/lib/components/PrivateRoute/index.d.ts +0 -1
package/index.esm.js
CHANGED
|
@@ -65,6 +65,9 @@ var apiTranslations = {
|
|
|
65
65
|
nl: nl
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
+
function _OverloadYield(e, d) {
|
|
69
|
+
this.v = e, this.k = d;
|
|
70
|
+
}
|
|
68
71
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
69
72
|
try {
|
|
70
73
|
var i = n[a](c),
|
|
@@ -99,306 +102,248 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
99
102
|
}
|
|
100
103
|
return t;
|
|
101
104
|
}
|
|
102
|
-
function
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
105
|
+
function _regenerator() {
|
|
106
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
107
|
+
var e,
|
|
108
|
+
t,
|
|
109
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
110
|
+
n = r.iterator || "@@iterator",
|
|
111
|
+
o = r.toStringTag || "@@toStringTag";
|
|
112
|
+
function i(r, n, o, i) {
|
|
113
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
114
|
+
u = Object.create(c.prototype);
|
|
115
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
116
|
+
var i,
|
|
117
|
+
c,
|
|
118
|
+
u,
|
|
119
|
+
f = 0,
|
|
120
|
+
p = o || [],
|
|
121
|
+
y = false,
|
|
122
|
+
G = {
|
|
123
|
+
p: 0,
|
|
124
|
+
n: 0,
|
|
125
|
+
v: e,
|
|
126
|
+
a: d,
|
|
127
|
+
f: d.bind(e, 4),
|
|
128
|
+
d: function (t, r) {
|
|
129
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
function d(r, n) {
|
|
133
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
134
|
+
var o,
|
|
135
|
+
i = p[t],
|
|
136
|
+
d = G.p,
|
|
137
|
+
l = i[2];
|
|
138
|
+
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
139
|
+
}
|
|
140
|
+
if (o || r > 1) return a;
|
|
141
|
+
throw y = true, n;
|
|
142
|
+
}
|
|
143
|
+
return function (o, p, l) {
|
|
144
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
145
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
146
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
147
|
+
try {
|
|
148
|
+
if (f = 2, i) {
|
|
149
|
+
if (c || (o = "next"), t = i[o]) {
|
|
150
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
151
|
+
if (!t.done) return t;
|
|
152
|
+
u = t.value, c < 2 && (c = 0);
|
|
153
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
154
|
+
i = e;
|
|
155
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
156
|
+
} catch (t) {
|
|
157
|
+
i = e, c = 1, u = t;
|
|
158
|
+
} finally {
|
|
159
|
+
f = 1;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
value: t,
|
|
164
|
+
done: y
|
|
165
|
+
};
|
|
150
166
|
};
|
|
151
|
-
}
|
|
167
|
+
}(r, o, i), true), u;
|
|
152
168
|
}
|
|
153
|
-
|
|
154
|
-
var h = "suspendedStart",
|
|
155
|
-
l = "suspendedYield",
|
|
156
|
-
f = "executing",
|
|
157
|
-
s = "completed",
|
|
158
|
-
y = {};
|
|
169
|
+
var a = {};
|
|
159
170
|
function Generator() {}
|
|
160
171
|
function GeneratorFunction() {}
|
|
161
172
|
function GeneratorFunctionPrototype() {}
|
|
162
|
-
|
|
163
|
-
|
|
173
|
+
t = Object.getPrototypeOf;
|
|
174
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
175
|
+
return this;
|
|
176
|
+
}), t),
|
|
177
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
178
|
+
function f(e) {
|
|
179
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
180
|
+
}
|
|
181
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
164
182
|
return this;
|
|
183
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
184
|
+
return "[object Generator]";
|
|
185
|
+
}), (_regenerator = function () {
|
|
186
|
+
return {
|
|
187
|
+
w: i,
|
|
188
|
+
m: f
|
|
189
|
+
};
|
|
190
|
+
})();
|
|
191
|
+
}
|
|
192
|
+
function _regeneratorAsync(n, e, r, t, o) {
|
|
193
|
+
var a = _regeneratorAsyncGen(n, e, r, t, o);
|
|
194
|
+
return a.next().then(function (n) {
|
|
195
|
+
return n.done ? n.value : a.next();
|
|
165
196
|
});
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
197
|
+
}
|
|
198
|
+
function _regeneratorAsyncGen(r, e, t, o, n) {
|
|
199
|
+
return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise);
|
|
200
|
+
}
|
|
201
|
+
function _regeneratorAsyncIterator(t, e) {
|
|
202
|
+
function n(r, o, i, f) {
|
|
203
|
+
try {
|
|
204
|
+
var c = t[r](o),
|
|
205
|
+
u = c.value;
|
|
206
|
+
return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) {
|
|
207
|
+
n("next", t, i, f);
|
|
208
|
+
}, function (t) {
|
|
209
|
+
n("throw", t, i, f);
|
|
210
|
+
}) : e.resolve(u).then(function (t) {
|
|
211
|
+
c.value = t, i(c);
|
|
212
|
+
}, function (t) {
|
|
213
|
+
return n("throw", t, i, f);
|
|
174
214
|
});
|
|
175
|
-
})
|
|
215
|
+
} catch (t) {
|
|
216
|
+
f(t);
|
|
217
|
+
}
|
|
176
218
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
219
|
+
var r;
|
|
220
|
+
this.next || (_regeneratorDefine(_regeneratorAsyncIterator.prototype), _regeneratorDefine(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
|
|
221
|
+
return this;
|
|
222
|
+
})), _regeneratorDefine(this, "_invoke", function (t, o, i) {
|
|
223
|
+
function f() {
|
|
224
|
+
return new e(function (e, r) {
|
|
225
|
+
n(t, i, e, r);
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
return r = r ? r.then(f, f) : f();
|
|
229
|
+
}, true);
|
|
230
|
+
}
|
|
231
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
232
|
+
var i = Object.defineProperty;
|
|
233
|
+
try {
|
|
234
|
+
i({}, "", {});
|
|
235
|
+
} catch (e) {
|
|
236
|
+
i = 0;
|
|
237
|
+
}
|
|
238
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
239
|
+
if (r) i ? i(e, r, {
|
|
240
|
+
value: n,
|
|
241
|
+
enumerable: !t,
|
|
242
|
+
configurable: !t,
|
|
243
|
+
writable: !t
|
|
244
|
+
}) : e[r] = n;else {
|
|
245
|
+
function o(r, n) {
|
|
246
|
+
_regeneratorDefine(e, r, function (e) {
|
|
247
|
+
return this._invoke(r, n, e);
|
|
191
248
|
});
|
|
192
249
|
}
|
|
193
|
-
|
|
250
|
+
o("next", 0), o("throw", 1), o("return", 2);
|
|
194
251
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
var
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
252
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
253
|
+
}
|
|
254
|
+
function _regeneratorKeys(e) {
|
|
255
|
+
var n = Object(e),
|
|
256
|
+
r = [];
|
|
257
|
+
for (var t in n) r.unshift(t);
|
|
258
|
+
return function e() {
|
|
259
|
+
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = false, e;
|
|
260
|
+
return e.done = true, e;
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function _regeneratorValues(e) {
|
|
264
|
+
if (null != e) {
|
|
265
|
+
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
|
|
266
|
+
r = 0;
|
|
267
|
+
if (t) return t.call(e);
|
|
268
|
+
if ("function" == typeof e.next) return e;
|
|
269
|
+
if (!isNaN(e.length)) return {
|
|
270
|
+
next: function () {
|
|
271
|
+
return e && r >= e.length && (e = void 0), {
|
|
272
|
+
value: e && e[r++],
|
|
273
|
+
done: !e
|
|
216
274
|
};
|
|
217
275
|
}
|
|
218
|
-
for (n.method = i, n.arg = a;;) {
|
|
219
|
-
var c = n.delegate;
|
|
220
|
-
if (c) {
|
|
221
|
-
var u = maybeInvokeDelegate(c, n);
|
|
222
|
-
if (u) {
|
|
223
|
-
if (u === y) continue;
|
|
224
|
-
return u;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
228
|
-
if (o === h) throw o = s, n.arg;
|
|
229
|
-
n.dispatchException(n.arg);
|
|
230
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
231
|
-
o = f;
|
|
232
|
-
var p = tryCatch(e, r, n);
|
|
233
|
-
if ("normal" === p.type) {
|
|
234
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
235
|
-
return {
|
|
236
|
-
value: p.arg,
|
|
237
|
-
done: n.done
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
function maybeInvokeDelegate(e, r) {
|
|
245
|
-
var n = r.method,
|
|
246
|
-
o = e.iterator[n];
|
|
247
|
-
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
248
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
249
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
250
|
-
var a = i.arg;
|
|
251
|
-
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
252
|
-
}
|
|
253
|
-
function pushTryEntry(t) {
|
|
254
|
-
var e = {
|
|
255
|
-
tryLoc: t[0]
|
|
256
276
|
};
|
|
257
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
258
277
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
278
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
279
|
+
}
|
|
280
|
+
function _regeneratorRuntime() {
|
|
281
|
+
|
|
282
|
+
var r = _regenerator(),
|
|
283
|
+
e = r.m(_regeneratorRuntime),
|
|
284
|
+
t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
|
|
285
|
+
function n(r) {
|
|
286
|
+
var e = "function" == typeof r && r.constructor;
|
|
287
|
+
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
|
|
267
288
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
289
|
+
var o = {
|
|
290
|
+
throw: 1,
|
|
291
|
+
return: 2,
|
|
292
|
+
break: 3,
|
|
293
|
+
continue: 3
|
|
294
|
+
};
|
|
295
|
+
function a(r) {
|
|
296
|
+
var e, t;
|
|
297
|
+
return function (n) {
|
|
298
|
+
e || (e = {
|
|
299
|
+
stop: function () {
|
|
300
|
+
return t(n.a, 2);
|
|
301
|
+
},
|
|
302
|
+
catch: function () {
|
|
303
|
+
return n.v;
|
|
304
|
+
},
|
|
305
|
+
abrupt: function (r, e) {
|
|
306
|
+
return t(n.a, o[r], e);
|
|
307
|
+
},
|
|
308
|
+
delegateYield: function (r, o, a) {
|
|
309
|
+
return e.resultName = o, t(n.d, _regeneratorValues(r), a);
|
|
310
|
+
},
|
|
311
|
+
finish: function (r) {
|
|
312
|
+
return t(n.f, r);
|
|
313
|
+
}
|
|
314
|
+
}, t = function (r, t, o) {
|
|
315
|
+
n.p = e.prev, n.n = e.next;
|
|
316
|
+
try {
|
|
317
|
+
return r(t, o);
|
|
318
|
+
} finally {
|
|
319
|
+
e.next = n.n;
|
|
320
|
+
}
|
|
321
|
+
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
|
|
322
|
+
try {
|
|
323
|
+
return r.call(this, e);
|
|
324
|
+
} finally {
|
|
325
|
+
n.p = e.prev, n.n = e.next;
|
|
280
326
|
}
|
|
281
|
-
}
|
|
282
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
327
|
+
};
|
|
283
328
|
}
|
|
284
|
-
return
|
|
285
|
-
value: GeneratorFunctionPrototype,
|
|
286
|
-
configurable: true
|
|
287
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
288
|
-
value: GeneratorFunction,
|
|
289
|
-
configurable: true
|
|
290
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
291
|
-
var e = "function" == typeof t && t.constructor;
|
|
292
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
293
|
-
}, e.mark = function (t) {
|
|
294
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
295
|
-
}, e.awrap = function (t) {
|
|
329
|
+
return (_regeneratorRuntime = function () {
|
|
296
330
|
return {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}), e.keys = function (t) {
|
|
312
|
-
var e = Object(t),
|
|
313
|
-
r = [];
|
|
314
|
-
for (var n in e) r.push(n);
|
|
315
|
-
return r.reverse(), function next() {
|
|
316
|
-
for (; r.length;) {
|
|
317
|
-
var t = r.pop();
|
|
318
|
-
if (t in e) return next.value = t, next.done = false, next;
|
|
319
|
-
}
|
|
320
|
-
return next.done = true, next;
|
|
331
|
+
wrap: function (e, t, n, o) {
|
|
332
|
+
return r.w(a(e), t, n, o && o.reverse());
|
|
333
|
+
},
|
|
334
|
+
isGeneratorFunction: n,
|
|
335
|
+
mark: r.m,
|
|
336
|
+
awrap: function (r, e) {
|
|
337
|
+
return new _OverloadYield(r, e);
|
|
338
|
+
},
|
|
339
|
+
AsyncIterator: _regeneratorAsyncIterator,
|
|
340
|
+
async: function (r, e, t, o, u) {
|
|
341
|
+
return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u);
|
|
342
|
+
},
|
|
343
|
+
keys: _regeneratorKeys,
|
|
344
|
+
values: _regeneratorValues
|
|
321
345
|
};
|
|
322
|
-
}
|
|
323
|
-
constructor: Context,
|
|
324
|
-
reset: function (e) {
|
|
325
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
326
|
-
},
|
|
327
|
-
stop: function () {
|
|
328
|
-
this.done = true;
|
|
329
|
-
var t = this.tryEntries[0].completion;
|
|
330
|
-
if ("throw" === t.type) throw t.arg;
|
|
331
|
-
return this.rval;
|
|
332
|
-
},
|
|
333
|
-
dispatchException: function (e) {
|
|
334
|
-
if (this.done) throw e;
|
|
335
|
-
var r = this;
|
|
336
|
-
function handle(n, o) {
|
|
337
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
338
|
-
}
|
|
339
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
340
|
-
var i = this.tryEntries[o],
|
|
341
|
-
a = i.completion;
|
|
342
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
343
|
-
if (i.tryLoc <= this.prev) {
|
|
344
|
-
var c = n.call(i, "catchLoc"),
|
|
345
|
-
u = n.call(i, "finallyLoc");
|
|
346
|
-
if (c && u) {
|
|
347
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
348
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
349
|
-
} else if (c) {
|
|
350
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
|
|
351
|
-
} else {
|
|
352
|
-
if (!u) throw Error("try statement without catch or finally");
|
|
353
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
},
|
|
358
|
-
abrupt: function (t, e) {
|
|
359
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
360
|
-
var o = this.tryEntries[r];
|
|
361
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
362
|
-
var i = o;
|
|
363
|
-
break;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
367
|
-
var a = i ? i.completion : {};
|
|
368
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
369
|
-
},
|
|
370
|
-
complete: function (t, e) {
|
|
371
|
-
if ("throw" === t.type) throw t.arg;
|
|
372
|
-
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
373
|
-
},
|
|
374
|
-
finish: function (t) {
|
|
375
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
376
|
-
var r = this.tryEntries[e];
|
|
377
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
378
|
-
}
|
|
379
|
-
},
|
|
380
|
-
catch: function (t) {
|
|
381
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
382
|
-
var r = this.tryEntries[e];
|
|
383
|
-
if (r.tryLoc === t) {
|
|
384
|
-
var n = r.completion;
|
|
385
|
-
if ("throw" === n.type) {
|
|
386
|
-
var o = n.arg;
|
|
387
|
-
resetTryEntry(r);
|
|
388
|
-
}
|
|
389
|
-
return o;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
throw Error("illegal catch attempt");
|
|
393
|
-
},
|
|
394
|
-
delegateYield: function (e, r, n) {
|
|
395
|
-
return this.delegate = {
|
|
396
|
-
iterator: values(e),
|
|
397
|
-
resultName: r,
|
|
398
|
-
nextLoc: n
|
|
399
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
400
|
-
}
|
|
401
|
-
}, e;
|
|
346
|
+
})();
|
|
402
347
|
}
|
|
403
348
|
|
|
404
349
|
var API_NAMESPACE$1 = 'api';
|
|
@@ -496,7 +441,7 @@ var refreshAccessToken = function refreshAccessToken(_ref) {
|
|
|
496
441
|
return tokenAxiosInstance.post(authTokenURL, data, axiosConfig);
|
|
497
442
|
};
|
|
498
443
|
var refreshAccessTokenAndSetAuthContext = /*#__PURE__*/function () {
|
|
499
|
-
var _ref3 = _asyncToGenerator(
|
|
444
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
|
|
500
445
|
var auth, onSetAuth, config, _ref2$timeout, timeout, configURLS, onLogin, refreshedToken, newAuth, _e$response, status;
|
|
501
446
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
502
447
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -556,8 +501,8 @@ var createApiInstance = function createApiInstance(_ref4) {
|
|
|
556
501
|
timeout: timeout
|
|
557
502
|
});
|
|
558
503
|
// Request interceptor for API calls done BEFORE the request is made.
|
|
559
|
-
axiosInstance.interceptors.request.use(
|
|
560
|
-
var _ref5 = _asyncToGenerator(
|
|
504
|
+
axiosInstance.interceptors.request.use(/*#__PURE__*/function () {
|
|
505
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(axiosConfig) {
|
|
561
506
|
var newConfig;
|
|
562
507
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
563
508
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -581,7 +526,7 @@ var createApiInstance = function createApiInstance(_ref4) {
|
|
|
581
526
|
return _ref5.apply(this, arguments);
|
|
582
527
|
};
|
|
583
528
|
}(), /*#__PURE__*/function () {
|
|
584
|
-
var _ref6 = _asyncToGenerator(
|
|
529
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(error) {
|
|
585
530
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
586
531
|
while (1) switch (_context3.prev = _context3.next) {
|
|
587
532
|
case 0:
|
|
@@ -601,7 +546,7 @@ var createApiInstance = function createApiInstance(_ref4) {
|
|
|
601
546
|
axiosInstance.interceptors.response.use(function (response) {
|
|
602
547
|
return response;
|
|
603
548
|
}, /*#__PURE__*/function () {
|
|
604
|
-
var _ref7 = _asyncToGenerator(
|
|
549
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(error) {
|
|
605
550
|
var originalRequest, _originalRequest$head;
|
|
606
551
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
607
552
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -643,8 +588,8 @@ var createNonAuthApiInstance = function createNonAuthApiInstance(_ref8) {
|
|
|
643
588
|
timeout: timeout
|
|
644
589
|
});
|
|
645
590
|
// Request interceptor for API calls
|
|
646
|
-
axiosInstance.interceptors.request.use(
|
|
647
|
-
var _ref9 = _asyncToGenerator(
|
|
591
|
+
axiosInstance.interceptors.request.use(/*#__PURE__*/function () {
|
|
592
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(config) {
|
|
648
593
|
var newConfig;
|
|
649
594
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
650
595
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -666,7 +611,7 @@ var createNonAuthApiInstance = function createNonAuthApiInstance(_ref8) {
|
|
|
666
611
|
return _ref9.apply(this, arguments);
|
|
667
612
|
};
|
|
668
613
|
}(), /*#__PURE__*/function () {
|
|
669
|
-
var
|
|
614
|
+
var _ref0 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(error) {
|
|
670
615
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
671
616
|
while (1) switch (_context6.prev = _context6.next) {
|
|
672
617
|
case 0:
|
|
@@ -679,7 +624,7 @@ var createNonAuthApiInstance = function createNonAuthApiInstance(_ref8) {
|
|
|
679
624
|
}, _callee6);
|
|
680
625
|
}));
|
|
681
626
|
return function (_x6) {
|
|
682
|
-
return
|
|
627
|
+
return _ref0.apply(this, arguments);
|
|
683
628
|
};
|
|
684
629
|
}());
|
|
685
630
|
return axiosInstance;
|
|
@@ -755,7 +700,7 @@ var getRandomString = function getRandomString() {
|
|
|
755
700
|
return randomString;
|
|
756
701
|
};
|
|
757
702
|
var getCodeChallenge = /*#__PURE__*/function () {
|
|
758
|
-
var _ref = _asyncToGenerator(
|
|
703
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(codeVerifier) {
|
|
759
704
|
var encoder, data, digest;
|
|
760
705
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
761
706
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -872,7 +817,7 @@ var AuthenticationProvider = function AuthenticationProvider(_ref2) {
|
|
|
872
817
|
// Checks the token expiration time regularly and renews it before it expires.
|
|
873
818
|
var interval = useRef();
|
|
874
819
|
React__default.useEffect(function () {
|
|
875
|
-
interval.current = setInterval(
|
|
820
|
+
interval.current = setInterval(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
876
821
|
var currentTime, timeInSecondsLeftBeforeExpiration;
|
|
877
822
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
878
823
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -947,7 +892,7 @@ var HandleOAuth2Code = function HandleOAuth2Code() {
|
|
|
947
892
|
var _useIsMounted = useIsMounted(),
|
|
948
893
|
isMounted = _useIsMounted.isMounted;
|
|
949
894
|
var loginInProgress = React__default.useRef(false);
|
|
950
|
-
var authenticate = React__default.useCallback(
|
|
895
|
+
var authenticate = React__default.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
951
896
|
var _Object$fromEntries, code, state, isStateRequired, isPkceRequired, payload, useDefaultContentType, data, config, res, newAuth;
|
|
952
897
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
953
898
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -1002,7 +947,8 @@ var HandleOAuth2Code = function HandleOAuth2Code() {
|
|
|
1002
947
|
config = {
|
|
1003
948
|
headers: {
|
|
1004
949
|
'content-type': useDefaultContentType ? 'application/json' : 'application/x-www-form-urlencoded'
|
|
1005
|
-
}
|
|
950
|
+
},
|
|
951
|
+
timeout: 30000
|
|
1006
952
|
};
|
|
1007
953
|
_context.prev = 15;
|
|
1008
954
|
_context.next = 18;
|
|
@@ -1049,7 +995,7 @@ var HandleOAuth2Code = function HandleOAuth2Code() {
|
|
|
1049
995
|
})), [authConfig, isMounted, onLogin, onSetAuth, sessionStorageProvider]);
|
|
1050
996
|
React__default.useEffect(function () {
|
|
1051
997
|
var authenticateWithLock = /*#__PURE__*/function () {
|
|
1052
|
-
var _ref2 = _asyncToGenerator(
|
|
998
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
1053
999
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1054
1000
|
while (1) switch (_context2.prev = _context2.next) {
|
|
1055
1001
|
case 0:
|
|
@@ -1299,16 +1245,6 @@ var UserMenuRolesConnect = function UserMenuRolesConnect(_ref) {
|
|
|
1299
1245
|
});
|
|
1300
1246
|
};
|
|
1301
1247
|
|
|
1302
|
-
var RequireAuth = function RequireAuth(_ref) {
|
|
1303
|
-
var children = _ref.children;
|
|
1304
|
-
var _useAuthenticationCon = useAuthenticationContext(),
|
|
1305
|
-
isLoggedIn = _useAuthenticationCon.isLoggedIn;
|
|
1306
|
-
if (!isLoggedIn) {
|
|
1307
|
-
window.location.assign('/login');
|
|
1308
|
-
}
|
|
1309
|
-
return children;
|
|
1310
|
-
};
|
|
1311
|
-
|
|
1312
1248
|
var _excluded = ["children", "createApi", "name"];
|
|
1313
1249
|
var ApiContext = /*#__PURE__*/React.createContext({
|
|
1314
1250
|
api: null
|
|
@@ -1390,7 +1326,7 @@ params, callbacks) {
|
|
|
1390
1326
|
}
|
|
1391
1327
|
};
|
|
1392
1328
|
var fetchApiData = /*#__PURE__*/function () {
|
|
1393
|
-
var _ref = _asyncToGenerator(
|
|
1329
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_params) {
|
|
1394
1330
|
var response, _callbacksRef$current2, data;
|
|
1395
1331
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1396
1332
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -1403,8 +1339,8 @@ params, callbacks) {
|
|
|
1403
1339
|
case 5:
|
|
1404
1340
|
response = _context.sent;
|
|
1405
1341
|
if (isMounted.current) {
|
|
1406
|
-
data = Array.isArray(response) ? response.map(function (
|
|
1407
|
-
return
|
|
1342
|
+
data = Array.isArray(response) ? response.map(function (dimension) {
|
|
1343
|
+
return dimension.data;
|
|
1408
1344
|
}) : response.data;
|
|
1409
1345
|
(_callbacksRef$current2 = callbacksRef.current) == null || _callbacksRef$current2.onSuccess == null || _callbacksRef$current2.onSuccess(data);
|
|
1410
1346
|
setResult(data);
|
|
@@ -1451,4 +1387,4 @@ params, callbacks) {
|
|
|
1451
1387
|
};
|
|
1452
1388
|
};
|
|
1453
1389
|
|
|
1454
|
-
export { AUTH_NAMESPACE, ApiProvider, AuthenticationContext, AuthenticationProvider, HandleOAuth2Code as Code, GEOWEB_ROLE_PRESETS_ADMIN, GEOWEB_ROLE_USER, KEEP_ALIVE_POLLER_IN_SECONDS, OAuth2Login as Login, OAuth2Logout as Logout, MILLISECOND_TO_SECOND, REFRESH_TOKEN_WHEN_PCT_EXPIRED,
|
|
1390
|
+
export { AUTH_NAMESPACE, ApiProvider, AuthenticationContext, AuthenticationProvider, HandleOAuth2Code as Code, GEOWEB_ROLE_PRESETS_ADMIN, GEOWEB_ROLE_USER, KEEP_ALIVE_POLLER_IN_SECONDS, OAuth2Login as Login, OAuth2Logout as Logout, MILLISECOND_TO_SECOND, REFRESH_TOKEN_WHEN_PCT_EXPIRED, UserMenuRoles, UserMenuRolesConnect, apiTranslations, authTranslations, createApiInstance, createFakeApiInstance, createNonAuthApiInstance, fakeApiRequest, getApi, getAuthConfig, getCodeChallenge, getCurrentTimeInSeconds, getCurrentUrlLocation, getRandomString, groupsToRoles, makeCredentialsFromTokenResponse, refreshAccessToken, refreshAccessTokenAndSetAuthContext, useApi, useApiContext, useAuthenticationContext, useAuthenticationDefaultProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/authentication",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.12.0",
|
|
4
4
|
"description": "GeoWeb authentication library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"axios": "^1.7.7",
|
|
12
12
|
"react-router-dom": "^6.23.1",
|
|
13
|
-
"@opengeoweb/shared": "12.
|
|
14
|
-
"@opengeoweb/theme": "12.
|
|
13
|
+
"@opengeoweb/shared": "12.12.0",
|
|
14
|
+
"@opengeoweb/theme": "12.12.0",
|
|
15
15
|
"i18next": "^25.0.1",
|
|
16
16
|
"react-i18next": "^15.1.1",
|
|
17
|
-
"@opengeoweb/snackbar": "12.
|
|
17
|
+
"@opengeoweb/snackbar": "12.12.0",
|
|
18
18
|
"react-redux": "^9.2.0",
|
|
19
19
|
"@reduxjs/toolkit": "^2.6.1",
|
|
20
20
|
"@mui/material": "^7.0.1"
|
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
"@emotion/react": "*",
|
|
25
25
|
"@emotion/styled": "*"
|
|
26
26
|
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"eslint-plugin-storybook": "9.0.17"
|
|
29
|
+
},
|
|
27
30
|
"module": "./index.esm.js",
|
|
28
31
|
"type": "module",
|
|
29
32
|
"main": "./index.esm.js",
|
package/src/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export { default as Login } from './lib/components/pages/Login';
|
|
|
5
5
|
export { default as Logout } from './lib/components/pages/Logout';
|
|
6
6
|
export * from './lib/components/UserMenuRoles';
|
|
7
7
|
export * from './lib/components/AuthenticationContext';
|
|
8
|
-
export * from './lib/components/PrivateRoute';
|
|
9
8
|
export * from './lib/components/ApiContext';
|
|
10
9
|
export * from './lib/components/apiHooks';
|
|
11
10
|
export * from './lib/utils/utils';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './RequireAuth';
|