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