@entur-partner/app-shell 4.0.1 → 5.0.1
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/dist/AppShell.d.ts +3 -3
- package/dist/app-shell.cjs.development.js +345 -523
- package/dist/app-shell.cjs.development.js.map +1 -1
- package/dist/app-shell.cjs.production.min.js +1 -1
- package/dist/app-shell.cjs.production.min.js.map +1 -1
- package/dist/app-shell.esm.js +346 -523
- package/dist/app-shell.esm.js.map +1 -1
- package/package.json +7 -5
- package/dist/Auth.d.ts +0 -21
- package/dist/authReducer.d.ts +0 -28
package/dist/app-shell.esm.js
CHANGED
|
@@ -1,302 +1,327 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import { Loader, SkeletonRectangle } from '@entur/loader';
|
|
1
|
+
import React, { useState, useEffect, useContext, useCallback } from 'react';
|
|
3
2
|
import { BannerAlertBox } from '@entur/alert';
|
|
4
|
-
import { space } from '@entur/tokens';
|
|
5
3
|
import { Paragraph, Link, CodeText } from '@entur/typography';
|
|
6
|
-
import {
|
|
4
|
+
import { Loader, SkeletonRectangle } from '@entur/loader';
|
|
5
|
+
import { space } from '@entur/tokens';
|
|
6
|
+
import { Auth0Provider, useAuth0 } from '@auth0/auth0-react';
|
|
7
7
|
import { getColorForEnvironment, Environment, OrganisationDropDown } from '@entur-partner/common';
|
|
8
|
-
import
|
|
8
|
+
import { assertIsDefined } from '@entur-partner/util';
|
|
9
9
|
|
|
10
|
+
function _construct(t, e, r) {
|
|
11
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
12
|
+
var o = [null];
|
|
13
|
+
o.push.apply(o, e);
|
|
14
|
+
var p = new (t.bind.apply(t, o))();
|
|
15
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
16
|
+
}
|
|
17
|
+
function _isNativeReflectConstruct() {
|
|
18
|
+
try {
|
|
19
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
20
|
+
} catch (t) {}
|
|
21
|
+
return (_isNativeReflectConstruct = function () {
|
|
22
|
+
return !!t;
|
|
23
|
+
})();
|
|
24
|
+
}
|
|
10
25
|
function _regeneratorRuntime() {
|
|
11
26
|
_regeneratorRuntime = function () {
|
|
12
|
-
return
|
|
27
|
+
return e;
|
|
13
28
|
};
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
var t,
|
|
30
|
+
e = {},
|
|
31
|
+
r = Object.prototype,
|
|
32
|
+
n = r.hasOwnProperty,
|
|
33
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
34
|
+
t[e] = r.value;
|
|
35
|
+
},
|
|
36
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
37
|
+
a = i.iterator || "@@iterator",
|
|
38
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
39
|
+
u = i.toStringTag || "@@toStringTag";
|
|
40
|
+
function define(t, e, r) {
|
|
41
|
+
return Object.defineProperty(t, e, {
|
|
42
|
+
value: r,
|
|
24
43
|
enumerable: !0,
|
|
25
44
|
configurable: !0,
|
|
26
45
|
writable: !0
|
|
27
|
-
}),
|
|
46
|
+
}), t[e];
|
|
28
47
|
}
|
|
29
48
|
try {
|
|
30
49
|
define({}, "");
|
|
31
|
-
} catch (
|
|
32
|
-
define = function (
|
|
33
|
-
return
|
|
50
|
+
} catch (t) {
|
|
51
|
+
define = function (t, e, r) {
|
|
52
|
+
return t[e] = r;
|
|
34
53
|
};
|
|
35
54
|
}
|
|
36
|
-
function wrap(
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
44
|
-
if ("completed" === state) {
|
|
45
|
-
if ("throw" === method) throw arg;
|
|
46
|
-
return doneResult();
|
|
47
|
-
}
|
|
48
|
-
for (context.method = method, context.arg = arg;;) {
|
|
49
|
-
var delegate = context.delegate;
|
|
50
|
-
if (delegate) {
|
|
51
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
52
|
-
if (delegateResult) {
|
|
53
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
54
|
-
return delegateResult;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
58
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
59
|
-
context.dispatchException(context.arg);
|
|
60
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
61
|
-
state = "executing";
|
|
62
|
-
var record = tryCatch(innerFn, self, context);
|
|
63
|
-
if ("normal" === record.type) {
|
|
64
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
65
|
-
return {
|
|
66
|
-
value: record.arg,
|
|
67
|
-
done: context.done
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}(innerFn, self, context), generator;
|
|
55
|
+
function wrap(t, e, r, n) {
|
|
56
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
57
|
+
a = Object.create(i.prototype),
|
|
58
|
+
c = new Context(n || []);
|
|
59
|
+
return o(a, "_invoke", {
|
|
60
|
+
value: makeInvokeMethod(t, r, c)
|
|
61
|
+
}), a;
|
|
74
62
|
}
|
|
75
|
-
function tryCatch(
|
|
63
|
+
function tryCatch(t, e, r) {
|
|
76
64
|
try {
|
|
77
65
|
return {
|
|
78
66
|
type: "normal",
|
|
79
|
-
arg:
|
|
67
|
+
arg: t.call(e, r)
|
|
80
68
|
};
|
|
81
|
-
} catch (
|
|
69
|
+
} catch (t) {
|
|
82
70
|
return {
|
|
83
71
|
type: "throw",
|
|
84
|
-
arg:
|
|
72
|
+
arg: t
|
|
85
73
|
};
|
|
86
74
|
}
|
|
87
75
|
}
|
|
88
|
-
|
|
89
|
-
var
|
|
76
|
+
e.wrap = wrap;
|
|
77
|
+
var h = "suspendedStart",
|
|
78
|
+
l = "suspendedYield",
|
|
79
|
+
f = "executing",
|
|
80
|
+
s = "completed",
|
|
81
|
+
y = {};
|
|
90
82
|
function Generator() {}
|
|
91
83
|
function GeneratorFunction() {}
|
|
92
84
|
function GeneratorFunctionPrototype() {}
|
|
93
|
-
var
|
|
94
|
-
define(
|
|
85
|
+
var p = {};
|
|
86
|
+
define(p, a, function () {
|
|
95
87
|
return this;
|
|
96
88
|
});
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
function defineIteratorMethods(
|
|
102
|
-
["next", "throw", "return"].forEach(function (
|
|
103
|
-
define(
|
|
104
|
-
return this._invoke(
|
|
89
|
+
var d = Object.getPrototypeOf,
|
|
90
|
+
v = d && d(d(values([])));
|
|
91
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
92
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
93
|
+
function defineIteratorMethods(t) {
|
|
94
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
95
|
+
define(t, e, function (t) {
|
|
96
|
+
return this._invoke(e, t);
|
|
105
97
|
});
|
|
106
98
|
});
|
|
107
99
|
}
|
|
108
|
-
function AsyncIterator(
|
|
109
|
-
function invoke(
|
|
110
|
-
var
|
|
111
|
-
if ("throw" !==
|
|
112
|
-
var
|
|
113
|
-
|
|
114
|
-
return
|
|
115
|
-
invoke("next",
|
|
116
|
-
}, function (
|
|
117
|
-
invoke("throw",
|
|
118
|
-
}) :
|
|
119
|
-
|
|
120
|
-
}, function (
|
|
121
|
-
return invoke("throw",
|
|
100
|
+
function AsyncIterator(t, e) {
|
|
101
|
+
function invoke(r, o, i, a) {
|
|
102
|
+
var c = tryCatch(t[r], t, o);
|
|
103
|
+
if ("throw" !== c.type) {
|
|
104
|
+
var u = c.arg,
|
|
105
|
+
h = u.value;
|
|
106
|
+
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
107
|
+
invoke("next", t, i, a);
|
|
108
|
+
}, function (t) {
|
|
109
|
+
invoke("throw", t, i, a);
|
|
110
|
+
}) : e.resolve(h).then(function (t) {
|
|
111
|
+
u.value = t, i(u);
|
|
112
|
+
}, function (t) {
|
|
113
|
+
return invoke("throw", t, i, a);
|
|
122
114
|
});
|
|
123
115
|
}
|
|
124
|
-
|
|
116
|
+
a(c.arg);
|
|
125
117
|
}
|
|
126
|
-
var
|
|
127
|
-
this
|
|
128
|
-
function
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
118
|
+
var r;
|
|
119
|
+
o(this, "_invoke", {
|
|
120
|
+
value: function (t, n) {
|
|
121
|
+
function callInvokeWithMethodAndArg() {
|
|
122
|
+
return new e(function (e, r) {
|
|
123
|
+
invoke(t, n, e, r);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
132
127
|
}
|
|
133
|
-
|
|
134
|
-
};
|
|
128
|
+
});
|
|
135
129
|
}
|
|
136
|
-
function
|
|
137
|
-
var
|
|
138
|
-
|
|
139
|
-
if (
|
|
140
|
-
|
|
141
|
-
|
|
130
|
+
function makeInvokeMethod(e, r, n) {
|
|
131
|
+
var o = h;
|
|
132
|
+
return function (i, a) {
|
|
133
|
+
if (o === f) throw Error("Generator is already running");
|
|
134
|
+
if (o === s) {
|
|
135
|
+
if ("throw" === i) throw a;
|
|
136
|
+
return {
|
|
137
|
+
value: t,
|
|
138
|
+
done: !0
|
|
139
|
+
};
|
|
142
140
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
for (n.method = i, n.arg = a;;) {
|
|
142
|
+
var c = n.delegate;
|
|
143
|
+
if (c) {
|
|
144
|
+
var u = maybeInvokeDelegate(c, n);
|
|
145
|
+
if (u) {
|
|
146
|
+
if (u === y) continue;
|
|
147
|
+
return u;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
151
|
+
if (o === h) throw o = s, n.arg;
|
|
152
|
+
n.dispatchException(n.arg);
|
|
153
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
154
|
+
o = f;
|
|
155
|
+
var p = tryCatch(e, r, n);
|
|
156
|
+
if ("normal" === p.type) {
|
|
157
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
158
|
+
return {
|
|
159
|
+
value: p.arg,
|
|
160
|
+
done: n.done
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
149
166
|
}
|
|
150
|
-
function
|
|
151
|
-
var
|
|
152
|
-
|
|
167
|
+
function maybeInvokeDelegate(e, r) {
|
|
168
|
+
var n = r.method,
|
|
169
|
+
o = e.iterator[n];
|
|
170
|
+
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;
|
|
171
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
172
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
173
|
+
var a = i.arg;
|
|
174
|
+
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);
|
|
175
|
+
}
|
|
176
|
+
function pushTryEntry(t) {
|
|
177
|
+
var e = {
|
|
178
|
+
tryLoc: t[0]
|
|
153
179
|
};
|
|
154
|
-
1 in
|
|
180
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
155
181
|
}
|
|
156
|
-
function resetTryEntry(
|
|
157
|
-
var
|
|
158
|
-
|
|
182
|
+
function resetTryEntry(t) {
|
|
183
|
+
var e = t.completion || {};
|
|
184
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
159
185
|
}
|
|
160
|
-
function Context(
|
|
186
|
+
function Context(t) {
|
|
161
187
|
this.tryEntries = [{
|
|
162
188
|
tryLoc: "root"
|
|
163
|
-
}],
|
|
189
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
164
190
|
}
|
|
165
|
-
function values(
|
|
166
|
-
if (
|
|
167
|
-
var
|
|
168
|
-
if (
|
|
169
|
-
if ("function" == typeof
|
|
170
|
-
if (!isNaN(
|
|
171
|
-
var
|
|
172
|
-
|
|
173
|
-
for (; ++
|
|
174
|
-
return next.value =
|
|
191
|
+
function values(e) {
|
|
192
|
+
if (e || "" === e) {
|
|
193
|
+
var r = e[a];
|
|
194
|
+
if (r) return r.call(e);
|
|
195
|
+
if ("function" == typeof e.next) return e;
|
|
196
|
+
if (!isNaN(e.length)) {
|
|
197
|
+
var o = -1,
|
|
198
|
+
i = function next() {
|
|
199
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
200
|
+
return next.value = t, next.done = !0, next;
|
|
175
201
|
};
|
|
176
|
-
return
|
|
202
|
+
return i.next = i;
|
|
177
203
|
}
|
|
178
204
|
}
|
|
179
|
-
|
|
180
|
-
next: doneResult
|
|
181
|
-
};
|
|
205
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
182
206
|
}
|
|
183
|
-
|
|
207
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
208
|
+
value: GeneratorFunctionPrototype,
|
|
209
|
+
configurable: !0
|
|
210
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
211
|
+
value: GeneratorFunction,
|
|
212
|
+
configurable: !0
|
|
213
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
214
|
+
var e = "function" == typeof t && t.constructor;
|
|
215
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
216
|
+
}, e.mark = function (t) {
|
|
217
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
218
|
+
}, e.awrap = function (t) {
|
|
184
219
|
return {
|
|
185
|
-
|
|
186
|
-
done: !0
|
|
220
|
+
__await: t
|
|
187
221
|
};
|
|
188
|
-
}
|
|
189
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
190
|
-
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
191
|
-
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
192
|
-
}, exports.mark = function (genFun) {
|
|
193
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
194
|
-
}, exports.awrap = function (arg) {
|
|
195
|
-
return {
|
|
196
|
-
__await: arg
|
|
197
|
-
};
|
|
198
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
222
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
199
223
|
return this;
|
|
200
|
-
}),
|
|
201
|
-
void 0 ===
|
|
202
|
-
var
|
|
203
|
-
return
|
|
204
|
-
return
|
|
224
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
225
|
+
void 0 === i && (i = Promise);
|
|
226
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
227
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
228
|
+
return t.done ? t.value : a.next();
|
|
205
229
|
});
|
|
206
|
-
}, defineIteratorMethods(
|
|
230
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
207
231
|
return this;
|
|
208
|
-
}), define(
|
|
232
|
+
}), define(g, "toString", function () {
|
|
209
233
|
return "[object Generator]";
|
|
210
|
-
}),
|
|
211
|
-
var
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
234
|
+
}), e.keys = function (t) {
|
|
235
|
+
var e = Object(t),
|
|
236
|
+
r = [];
|
|
237
|
+
for (var n in e) r.push(n);
|
|
238
|
+
return r.reverse(), function next() {
|
|
239
|
+
for (; r.length;) {
|
|
240
|
+
var t = r.pop();
|
|
241
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
217
242
|
}
|
|
218
243
|
return next.done = !0, next;
|
|
219
244
|
};
|
|
220
|
-
},
|
|
245
|
+
}, e.values = values, Context.prototype = {
|
|
221
246
|
constructor: Context,
|
|
222
|
-
reset: function (
|
|
223
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
247
|
+
reset: function (e) {
|
|
248
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, 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);
|
|
224
249
|
},
|
|
225
250
|
stop: function () {
|
|
226
251
|
this.done = !0;
|
|
227
|
-
var
|
|
228
|
-
if ("throw" ===
|
|
252
|
+
var t = this.tryEntries[0].completion;
|
|
253
|
+
if ("throw" === t.type) throw t.arg;
|
|
229
254
|
return this.rval;
|
|
230
255
|
},
|
|
231
|
-
dispatchException: function (
|
|
232
|
-
if (this.done) throw
|
|
233
|
-
var
|
|
234
|
-
function handle(
|
|
235
|
-
return
|
|
256
|
+
dispatchException: function (e) {
|
|
257
|
+
if (this.done) throw e;
|
|
258
|
+
var r = this;
|
|
259
|
+
function handle(n, o) {
|
|
260
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
236
261
|
}
|
|
237
|
-
for (var
|
|
238
|
-
var
|
|
239
|
-
|
|
240
|
-
if ("root" ===
|
|
241
|
-
if (
|
|
242
|
-
var
|
|
243
|
-
|
|
244
|
-
if (
|
|
245
|
-
if (this.prev <
|
|
246
|
-
if (this.prev <
|
|
247
|
-
} else if (
|
|
248
|
-
if (this.prev <
|
|
262
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
263
|
+
var i = this.tryEntries[o],
|
|
264
|
+
a = i.completion;
|
|
265
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
266
|
+
if (i.tryLoc <= this.prev) {
|
|
267
|
+
var c = n.call(i, "catchLoc"),
|
|
268
|
+
u = n.call(i, "finallyLoc");
|
|
269
|
+
if (c && u) {
|
|
270
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
271
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
272
|
+
} else if (c) {
|
|
273
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
249
274
|
} else {
|
|
250
|
-
if (!
|
|
251
|
-
if (this.prev <
|
|
275
|
+
if (!u) throw Error("try statement without catch or finally");
|
|
276
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
252
277
|
}
|
|
253
278
|
}
|
|
254
279
|
}
|
|
255
280
|
},
|
|
256
|
-
abrupt: function (
|
|
257
|
-
for (var
|
|
258
|
-
var
|
|
259
|
-
if (
|
|
260
|
-
var
|
|
281
|
+
abrupt: function (t, e) {
|
|
282
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
283
|
+
var o = this.tryEntries[r];
|
|
284
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
285
|
+
var i = o;
|
|
261
286
|
break;
|
|
262
287
|
}
|
|
263
288
|
}
|
|
264
|
-
|
|
265
|
-
var
|
|
266
|
-
return
|
|
289
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
290
|
+
var a = i ? i.completion : {};
|
|
291
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
267
292
|
},
|
|
268
|
-
complete: function (
|
|
269
|
-
if ("throw" ===
|
|
270
|
-
return "break" ===
|
|
293
|
+
complete: function (t, e) {
|
|
294
|
+
if ("throw" === t.type) throw t.arg;
|
|
295
|
+
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;
|
|
271
296
|
},
|
|
272
|
-
finish: function (
|
|
273
|
-
for (var
|
|
274
|
-
var
|
|
275
|
-
if (
|
|
297
|
+
finish: function (t) {
|
|
298
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
299
|
+
var r = this.tryEntries[e];
|
|
300
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
276
301
|
}
|
|
277
302
|
},
|
|
278
|
-
catch: function (
|
|
279
|
-
for (var
|
|
280
|
-
var
|
|
281
|
-
if (
|
|
282
|
-
var
|
|
283
|
-
if ("throw" ===
|
|
284
|
-
var
|
|
285
|
-
resetTryEntry(
|
|
303
|
+
catch: function (t) {
|
|
304
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
305
|
+
var r = this.tryEntries[e];
|
|
306
|
+
if (r.tryLoc === t) {
|
|
307
|
+
var n = r.completion;
|
|
308
|
+
if ("throw" === n.type) {
|
|
309
|
+
var o = n.arg;
|
|
310
|
+
resetTryEntry(r);
|
|
286
311
|
}
|
|
287
|
-
return
|
|
312
|
+
return o;
|
|
288
313
|
}
|
|
289
314
|
}
|
|
290
|
-
throw
|
|
315
|
+
throw Error("illegal catch attempt");
|
|
291
316
|
},
|
|
292
|
-
delegateYield: function (
|
|
317
|
+
delegateYield: function (e, r, n) {
|
|
293
318
|
return this.delegate = {
|
|
294
|
-
iterator: values(
|
|
295
|
-
resultName:
|
|
296
|
-
nextLoc:
|
|
297
|
-
}, "next" === this.method && (this.arg =
|
|
319
|
+
iterator: values(e),
|
|
320
|
+
resultName: r,
|
|
321
|
+
nextLoc: n
|
|
322
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
298
323
|
}
|
|
299
|
-
},
|
|
324
|
+
}, e;
|
|
300
325
|
}
|
|
301
326
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
302
327
|
try {
|
|
@@ -360,34 +385,12 @@ function _setPrototypeOf(o, p) {
|
|
|
360
385
|
};
|
|
361
386
|
return _setPrototypeOf(o, p);
|
|
362
387
|
}
|
|
363
|
-
function
|
|
364
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
365
|
-
if (Reflect.construct.sham) return false;
|
|
366
|
-
if (typeof Proxy === "function") return true;
|
|
388
|
+
function _isNativeFunction(fn) {
|
|
367
389
|
try {
|
|
368
|
-
|
|
369
|
-
return true;
|
|
390
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
370
391
|
} catch (e) {
|
|
371
|
-
return
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
function _construct(Parent, args, Class) {
|
|
375
|
-
if (_isNativeReflectConstruct()) {
|
|
376
|
-
_construct = Reflect.construct.bind();
|
|
377
|
-
} else {
|
|
378
|
-
_construct = function _construct(Parent, args, Class) {
|
|
379
|
-
var a = [null];
|
|
380
|
-
a.push.apply(a, args);
|
|
381
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
382
|
-
var instance = new Constructor();
|
|
383
|
-
if (Class) _setPrototypeOf(instance, Class.prototype);
|
|
384
|
-
return instance;
|
|
385
|
-
};
|
|
392
|
+
return typeof fn === "function";
|
|
386
393
|
}
|
|
387
|
-
return _construct.apply(null, arguments);
|
|
388
|
-
}
|
|
389
|
-
function _isNativeFunction(fn) {
|
|
390
|
-
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
391
394
|
}
|
|
392
395
|
function _wrapNativeSuper(Class) {
|
|
393
396
|
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
@@ -428,234 +431,6 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
428
431
|
return target;
|
|
429
432
|
}
|
|
430
433
|
|
|
431
|
-
var initialState$1 = {
|
|
432
|
-
status: 'AUTHENTICATING'
|
|
433
|
-
};
|
|
434
|
-
function authReducer(state, event) {
|
|
435
|
-
switch (event.type) {
|
|
436
|
-
case 'AUTHENTICATED':
|
|
437
|
-
return {
|
|
438
|
-
status: 'AUTHENTICATED',
|
|
439
|
-
user: event.data.user
|
|
440
|
-
};
|
|
441
|
-
case 'LOGOUT':
|
|
442
|
-
return initialState$1;
|
|
443
|
-
case 'ERROR':
|
|
444
|
-
return {
|
|
445
|
-
error: event.error,
|
|
446
|
-
status: 'ERROR'
|
|
447
|
-
};
|
|
448
|
-
case 'NOT_AUTHENTICATED':
|
|
449
|
-
return _extends({}, state, {
|
|
450
|
-
status: 'NOT_AUTHENTICATED'
|
|
451
|
-
});
|
|
452
|
-
default:
|
|
453
|
-
return state;
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
var _excluded$2 = ["children", "decorateUser"];
|
|
458
|
-
var POST_LOGIN_ROUTE_KEY = '@entur-partner:post-login-route';
|
|
459
|
-
var LOGIN_LAST_RETRY = '@entur-partner:last-login-retry';
|
|
460
|
-
var redirect = function redirect(pathname) {
|
|
461
|
-
if (pathname === void 0) {
|
|
462
|
-
pathname = '/';
|
|
463
|
-
}
|
|
464
|
-
return window.history.replaceState({}, document.title, pathname);
|
|
465
|
-
}; // TODO: replace with react-router history
|
|
466
|
-
var Auth0Context = /*#__PURE__*/React.createContext(undefined);
|
|
467
|
-
var useAuth = function useAuth() {
|
|
468
|
-
var auth = useContext(Auth0Context);
|
|
469
|
-
assertIsDefined(auth, 'A `<Auth0Provider>` component needs to be higher up in the component hierarchy.');
|
|
470
|
-
return auth;
|
|
471
|
-
};
|
|
472
|
-
var initialState = {
|
|
473
|
-
status: 'AUTHENTICATING'
|
|
474
|
-
};
|
|
475
|
-
var AuthProvider = function AuthProvider(_ref) {
|
|
476
|
-
var children = _ref.children,
|
|
477
|
-
decorateUser = _ref.decorateUser,
|
|
478
|
-
initOptions = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
479
|
-
var _useReducer = useReducer(authReducer, initialState),
|
|
480
|
-
state = _useReducer[0],
|
|
481
|
-
dispatch = _useReducer[1];
|
|
482
|
-
var _useState = useState(),
|
|
483
|
-
auth0Client = _useState[0],
|
|
484
|
-
setAuth0 = _useState[1];
|
|
485
|
-
useEffect(function () {
|
|
486
|
-
var initAuth0 = /*#__PURE__*/function () {
|
|
487
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
488
|
-
var client, route, postLoginRoute, isAuthenticated, auth0User, token, user;
|
|
489
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
490
|
-
while (1) switch (_context.prev = _context.next) {
|
|
491
|
-
case 0:
|
|
492
|
-
_context.next = 2;
|
|
493
|
-
return createAuth0Client(initOptions);
|
|
494
|
-
case 2:
|
|
495
|
-
client = _context.sent;
|
|
496
|
-
setAuth0(client);
|
|
497
|
-
if (!window.location.search.includes('code=')) {
|
|
498
|
-
_context.next = 11;
|
|
499
|
-
break;
|
|
500
|
-
}
|
|
501
|
-
_context.next = 7;
|
|
502
|
-
return client.handleRedirectCallback();
|
|
503
|
-
case 7:
|
|
504
|
-
route = localStorage.getItem(POST_LOGIN_ROUTE_KEY);
|
|
505
|
-
localStorage.removeItem(POST_LOGIN_ROUTE_KEY);
|
|
506
|
-
postLoginRoute = route || '/';
|
|
507
|
-
redirect(postLoginRoute);
|
|
508
|
-
case 11:
|
|
509
|
-
_context.next = 13;
|
|
510
|
-
return client.isAuthenticated();
|
|
511
|
-
case 13:
|
|
512
|
-
isAuthenticated = _context.sent;
|
|
513
|
-
if (!isAuthenticated) {
|
|
514
|
-
_context.next = 27;
|
|
515
|
-
break;
|
|
516
|
-
}
|
|
517
|
-
_context.next = 17;
|
|
518
|
-
return client.getUser();
|
|
519
|
-
case 17:
|
|
520
|
-
auth0User = _context.sent;
|
|
521
|
-
_context.next = 20;
|
|
522
|
-
return client.getTokenSilently();
|
|
523
|
-
case 20:
|
|
524
|
-
token = _context.sent;
|
|
525
|
-
_context.next = 23;
|
|
526
|
-
return decorateUser(auth0User, token);
|
|
527
|
-
case 23:
|
|
528
|
-
user = _context.sent;
|
|
529
|
-
dispatch({
|
|
530
|
-
type: 'AUTHENTICATED',
|
|
531
|
-
data: {
|
|
532
|
-
user: user
|
|
533
|
-
}
|
|
534
|
-
});
|
|
535
|
-
_context.next = 28;
|
|
536
|
-
break;
|
|
537
|
-
case 27:
|
|
538
|
-
dispatch({
|
|
539
|
-
type: 'NOT_AUTHENTICATED'
|
|
540
|
-
});
|
|
541
|
-
case 28:
|
|
542
|
-
case "end":
|
|
543
|
-
return _context.stop();
|
|
544
|
-
}
|
|
545
|
-
}, _callee);
|
|
546
|
-
}));
|
|
547
|
-
return function initAuth0() {
|
|
548
|
-
return _ref2.apply(this, arguments);
|
|
549
|
-
};
|
|
550
|
-
}();
|
|
551
|
-
initAuth0()["catch"]( /*#__PURE__*/function () {
|
|
552
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(error) {
|
|
553
|
-
var _localStorage$getItem, lastRetryEpochSeconds, nowEpochSeconds, timeSinceLastRetry, minimumTimeForRetry;
|
|
554
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
555
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
556
|
-
case 0:
|
|
557
|
-
_context2.prev = 0;
|
|
558
|
-
lastRetryEpochSeconds = parseInt((_localStorage$getItem = localStorage.getItem(LOGIN_LAST_RETRY)) != null ? _localStorage$getItem : '0');
|
|
559
|
-
nowEpochSeconds = Math.floor(Date.now() / 1000);
|
|
560
|
-
timeSinceLastRetry = nowEpochSeconds - lastRetryEpochSeconds;
|
|
561
|
-
minimumTimeForRetry = 120; // Has there been more than x seconds since last retry?
|
|
562
|
-
if (!(timeSinceLastRetry >= minimumTimeForRetry)) {
|
|
563
|
-
_context2.next = 12;
|
|
564
|
-
break;
|
|
565
|
-
}
|
|
566
|
-
localStorage.setItem(LOGIN_LAST_RETRY, nowEpochSeconds.toString());
|
|
567
|
-
redirect('/');
|
|
568
|
-
_context2.next = 10;
|
|
569
|
-
return initAuth0();
|
|
570
|
-
case 10:
|
|
571
|
-
_context2.next = 13;
|
|
572
|
-
break;
|
|
573
|
-
case 12:
|
|
574
|
-
throw error;
|
|
575
|
-
case 13:
|
|
576
|
-
_context2.next = 18;
|
|
577
|
-
break;
|
|
578
|
-
case 15:
|
|
579
|
-
_context2.prev = 15;
|
|
580
|
-
_context2.t0 = _context2["catch"](0);
|
|
581
|
-
dispatch({
|
|
582
|
-
type: 'ERROR',
|
|
583
|
-
error: error
|
|
584
|
-
});
|
|
585
|
-
case 18:
|
|
586
|
-
case "end":
|
|
587
|
-
return _context2.stop();
|
|
588
|
-
}
|
|
589
|
-
}, _callee2, null, [[0, 15]]);
|
|
590
|
-
}));
|
|
591
|
-
return function (_x) {
|
|
592
|
-
return _ref3.apply(this, arguments);
|
|
593
|
-
};
|
|
594
|
-
}());
|
|
595
|
-
// eslint-disable-next-line
|
|
596
|
-
}, []);
|
|
597
|
-
var logout = function logout() {
|
|
598
|
-
assertIsDefined(auth0Client);
|
|
599
|
-
var _window$location = window.location,
|
|
600
|
-
protocol = _window$location.protocol,
|
|
601
|
-
hostname = _window$location.hostname,
|
|
602
|
-
port = _window$location.port;
|
|
603
|
-
auth0Client.logout({
|
|
604
|
-
returnTo: protocol + "//" + hostname + ":" + port
|
|
605
|
-
});
|
|
606
|
-
};
|
|
607
|
-
var login = /*#__PURE__*/function () {
|
|
608
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(redirectUri) {
|
|
609
|
-
var _window, location;
|
|
610
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
611
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
612
|
-
case 0:
|
|
613
|
-
if (redirectUri === void 0) {
|
|
614
|
-
redirectUri = window.location.origin;
|
|
615
|
-
}
|
|
616
|
-
assertIsDefined(auth0Client);
|
|
617
|
-
_window = window, location = _window.location;
|
|
618
|
-
localStorage.setItem(POST_LOGIN_ROUTE_KEY, "" + location.pathname + location.search);
|
|
619
|
-
auth0Client.loginWithRedirect({
|
|
620
|
-
redirect_uri: redirectUri
|
|
621
|
-
});
|
|
622
|
-
case 5:
|
|
623
|
-
case "end":
|
|
624
|
-
return _context3.stop();
|
|
625
|
-
}
|
|
626
|
-
}, _callee3);
|
|
627
|
-
}));
|
|
628
|
-
return function login(_x2) {
|
|
629
|
-
return _ref4.apply(this, arguments);
|
|
630
|
-
};
|
|
631
|
-
}();
|
|
632
|
-
var getToken = /*#__PURE__*/function () {
|
|
633
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(options) {
|
|
634
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
635
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
636
|
-
case 0:
|
|
637
|
-
assertIsDefined(auth0Client);
|
|
638
|
-
return _context4.abrupt("return", auth0Client.getTokenSilently(options));
|
|
639
|
-
case 2:
|
|
640
|
-
case "end":
|
|
641
|
-
return _context4.stop();
|
|
642
|
-
}
|
|
643
|
-
}, _callee4);
|
|
644
|
-
}));
|
|
645
|
-
return function getToken(_x3) {
|
|
646
|
-
return _ref5.apply(this, arguments);
|
|
647
|
-
};
|
|
648
|
-
}();
|
|
649
|
-
return React.createElement(Auth0Context.Provider, {
|
|
650
|
-
value: _extends({}, state, {
|
|
651
|
-
auth0Client: auth0Client,
|
|
652
|
-
logout: logout,
|
|
653
|
-
getToken: getToken,
|
|
654
|
-
login: login
|
|
655
|
-
})
|
|
656
|
-
}, children);
|
|
657
|
-
};
|
|
658
|
-
|
|
659
434
|
var EnvironmentBanner = function EnvironmentBanner(_ref) {
|
|
660
435
|
var environment = _ref.environment;
|
|
661
436
|
return React.createElement("div", {
|
|
@@ -673,73 +448,121 @@ var EnvironmentBanner = function EnvironmentBanner(_ref) {
|
|
|
673
448
|
});
|
|
674
449
|
};
|
|
675
450
|
|
|
676
|
-
|
|
677
|
-
var
|
|
678
|
-
|
|
679
|
-
|
|
451
|
+
function userLogout(logout) {
|
|
452
|
+
var _window$location = window.location,
|
|
453
|
+
protocol = _window$location.protocol,
|
|
454
|
+
hostname = _window$location.hostname,
|
|
455
|
+
port = _window$location.port;
|
|
456
|
+
return logout({
|
|
457
|
+
logoutParams: {
|
|
458
|
+
returnTo: protocol + "//" + hostname + ":" + port
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
var Authenticate = function Authenticate(_ref) {
|
|
463
|
+
var children = _ref.children,
|
|
464
|
+
decorateUser = _ref.decorateUser;
|
|
465
|
+
var _useState = useState(undefined),
|
|
466
|
+
userWithPermission = _useState[0],
|
|
467
|
+
setUserWithPermission = _useState[1];
|
|
468
|
+
var _useAuth = useAuth0(),
|
|
469
|
+
user = _useAuth.user,
|
|
470
|
+
getAccessTokenSilently = _useAuth.getAccessTokenSilently,
|
|
471
|
+
loginWithRedirect = _useAuth.loginWithRedirect,
|
|
472
|
+
_logout = _useAuth.logout,
|
|
473
|
+
isLoading = _useAuth.isLoading,
|
|
474
|
+
isAuthenticated = _useAuth.isAuthenticated,
|
|
475
|
+
error = _useAuth.error;
|
|
680
476
|
useEffect(function () {
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
477
|
+
var fetchUserData = /*#__PURE__*/function () {
|
|
478
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
479
|
+
var token, decoratedUser;
|
|
480
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
481
|
+
while (1) switch (_context.prev = _context.next) {
|
|
482
|
+
case 0:
|
|
483
|
+
_context.prev = 0;
|
|
484
|
+
_context.next = 3;
|
|
485
|
+
return getAccessTokenSilently();
|
|
486
|
+
case 3:
|
|
487
|
+
token = _context.sent;
|
|
488
|
+
_context.next = 6;
|
|
489
|
+
return decorateUser(user, token);
|
|
490
|
+
case 6:
|
|
491
|
+
decoratedUser = _context.sent;
|
|
492
|
+
setUserWithPermission(decoratedUser);
|
|
493
|
+
_context.next = 13;
|
|
494
|
+
break;
|
|
495
|
+
case 10:
|
|
496
|
+
_context.prev = 10;
|
|
497
|
+
_context.t0 = _context["catch"](0);
|
|
498
|
+
console.error('Error fetching user data:', _context.t0);
|
|
499
|
+
case 13:
|
|
500
|
+
case "end":
|
|
501
|
+
return _context.stop();
|
|
502
|
+
}
|
|
503
|
+
}, _callee, null, [[0, 10]]);
|
|
705
504
|
}));
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
505
|
+
return function fetchUserData() {
|
|
506
|
+
return _ref2.apply(this, arguments);
|
|
507
|
+
};
|
|
508
|
+
}();
|
|
509
|
+
if (isAuthenticated) {
|
|
510
|
+
fetchUserData();
|
|
511
|
+
}
|
|
512
|
+
}, [decorateUser, getAccessTokenSilently, isAuthenticated, user]);
|
|
513
|
+
if (!isLoading && !isAuthenticated) {
|
|
514
|
+
loginWithRedirect();
|
|
515
|
+
return React.createElement(Loader, {
|
|
516
|
+
style: {
|
|
517
|
+
marginTop: space.extraLarge9
|
|
518
|
+
}
|
|
519
|
+
}, "Redirecting to login page");
|
|
520
|
+
}
|
|
521
|
+
if (isLoading || !userWithPermission) {
|
|
522
|
+
return React.createElement(Loader, {
|
|
523
|
+
style: {
|
|
524
|
+
marginTop: space.extraLarge9
|
|
525
|
+
}
|
|
526
|
+
}, "Authenticating");
|
|
726
527
|
}
|
|
528
|
+
if (error) {
|
|
529
|
+
process.env.NODE_ENV !== 'production' && console.error(error);
|
|
530
|
+
return React.createElement(BannerAlertBox, {
|
|
531
|
+
variant: "error",
|
|
532
|
+
title: "Authentication failed",
|
|
533
|
+
style: {
|
|
534
|
+
maxWidth: '600px',
|
|
535
|
+
margin: '0 auto'
|
|
536
|
+
}
|
|
537
|
+
}, React.createElement(Paragraph, null, "Something went wrong while trying to authenticate you. If the problem persists you should contact", ' ', React.createElement(Link, {
|
|
538
|
+
href: "mailto:support@entur.org"
|
|
539
|
+
}, "support@entur.org"), " to get it resolved."), React.createElement(Paragraph, null, "Authentication failed with: ", React.createElement(CodeText, null, error == null ? void 0 : error.toString())));
|
|
540
|
+
}
|
|
541
|
+
assertIsDefined(userWithPermission);
|
|
542
|
+
return React.createElement(React.Fragment, null, children({
|
|
543
|
+
user: userWithPermission,
|
|
544
|
+
logout: function logout() {
|
|
545
|
+
return userLogout(_logout);
|
|
546
|
+
},
|
|
547
|
+
getToken: getAccessTokenSilently
|
|
548
|
+
}));
|
|
727
549
|
};
|
|
728
550
|
var AppShell = function AppShell(_ref3) {
|
|
729
551
|
var children = _ref3.children,
|
|
730
552
|
audience = _ref3.audience,
|
|
731
553
|
domain = _ref3.domain,
|
|
732
554
|
clientId = _ref3.clientId,
|
|
733
|
-
redirectUri = _ref3.redirectUri,
|
|
734
555
|
decorateUser = _ref3.decorateUser,
|
|
735
556
|
environment = _ref3.environment;
|
|
736
|
-
return React.createElement(
|
|
737
|
-
audience: audience,
|
|
557
|
+
return React.createElement(Auth0Provider, {
|
|
738
558
|
domain: domain,
|
|
739
|
-
|
|
740
|
-
|
|
559
|
+
clientId: clientId,
|
|
560
|
+
authorizationParams: {
|
|
561
|
+
redirect_uri: window.location.origin,
|
|
562
|
+
audience: audience
|
|
563
|
+
}
|
|
741
564
|
}, React.createElement(Authenticate, {
|
|
742
|
-
|
|
565
|
+
decorateUser: decorateUser
|
|
743
566
|
}, function (params) {
|
|
744
567
|
return React.createElement(React.Fragment, null, environment && environment !== Environment.Production && React.createElement(EnvironmentBanner, {
|
|
745
568
|
environment: environment
|
|
@@ -922,7 +745,6 @@ var LanguageProvider = function LanguageProvider(_ref) {
|
|
|
922
745
|
};
|
|
923
746
|
|
|
924
747
|
var OrganisationsError = /*#__PURE__*/function (_Error) {
|
|
925
|
-
_inheritsLoose(OrganisationsError, _Error);
|
|
926
748
|
function OrganisationsError() {
|
|
927
749
|
var _this;
|
|
928
750
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -932,6 +754,7 @@ var OrganisationsError = /*#__PURE__*/function (_Error) {
|
|
|
932
754
|
_this.message = 'Failed fetching organisations';
|
|
933
755
|
return _this;
|
|
934
756
|
}
|
|
757
|
+
_inheritsLoose(OrganisationsError, _Error);
|
|
935
758
|
return OrganisationsError;
|
|
936
759
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
937
760
|
|