dauth-context-react 1.0.2 → 1.0.3
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/dauth-context-react.cjs.development.js +406 -647
- package/dist/dauth-context-react.cjs.development.js.map +1 -1
- package/dist/dauth-context-react.cjs.production.min.js +1 -1
- package/dist/dauth-context-react.cjs.production.min.js.map +1 -1
- package/dist/dauth-context-react.esm.js +406 -647
- package/dist/dauth-context-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/reducer/dauth.actions.ts +1 -5
|
@@ -1,349 +1,146 @@
|
|
|
1
1
|
import React, { useReducer, useCallback, useEffect, useMemo, createContext, useContext } from 'react';
|
|
2
2
|
|
|
3
|
-
function
|
|
4
|
-
_regeneratorRuntime = function () {
|
|
5
|
-
return e;
|
|
6
|
-
};
|
|
7
|
-
var t,
|
|
8
|
-
e = {},
|
|
9
|
-
r = Object.prototype,
|
|
10
|
-
n = r.hasOwnProperty,
|
|
11
|
-
o = Object.defineProperty || function (t, e, r) {
|
|
12
|
-
t[e] = r.value;
|
|
13
|
-
},
|
|
14
|
-
i = "function" == typeof Symbol ? Symbol : {},
|
|
15
|
-
a = i.iterator || "@@iterator",
|
|
16
|
-
c = i.asyncIterator || "@@asyncIterator",
|
|
17
|
-
u = i.toStringTag || "@@toStringTag";
|
|
18
|
-
function define(t, e, r) {
|
|
19
|
-
return Object.defineProperty(t, e, {
|
|
20
|
-
value: r,
|
|
21
|
-
enumerable: !0,
|
|
22
|
-
configurable: !0,
|
|
23
|
-
writable: !0
|
|
24
|
-
}), t[e];
|
|
25
|
-
}
|
|
3
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
26
4
|
try {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
function wrap(t, e, r, n) {
|
|
34
|
-
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
35
|
-
a = Object.create(i.prototype),
|
|
36
|
-
c = new Context(n || []);
|
|
37
|
-
return o(a, "_invoke", {
|
|
38
|
-
value: makeInvokeMethod(t, r, c)
|
|
39
|
-
}), a;
|
|
40
|
-
}
|
|
41
|
-
function tryCatch(t, e, r) {
|
|
42
|
-
try {
|
|
43
|
-
return {
|
|
44
|
-
type: "normal",
|
|
45
|
-
arg: t.call(e, r)
|
|
46
|
-
};
|
|
47
|
-
} catch (t) {
|
|
48
|
-
return {
|
|
49
|
-
type: "throw",
|
|
50
|
-
arg: t
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
e.wrap = wrap;
|
|
55
|
-
var h = "suspendedStart",
|
|
56
|
-
l = "suspendedYield",
|
|
57
|
-
f = "executing",
|
|
58
|
-
s = "completed",
|
|
59
|
-
y = {};
|
|
60
|
-
function Generator() {}
|
|
61
|
-
function GeneratorFunction() {}
|
|
62
|
-
function GeneratorFunctionPrototype() {}
|
|
63
|
-
var p = {};
|
|
64
|
-
define(p, a, function () {
|
|
65
|
-
return this;
|
|
66
|
-
});
|
|
67
|
-
var d = Object.getPrototypeOf,
|
|
68
|
-
v = d && d(d(values([])));
|
|
69
|
-
v && v !== r && n.call(v, a) && (p = v);
|
|
70
|
-
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
71
|
-
function defineIteratorMethods(t) {
|
|
72
|
-
["next", "throw", "return"].forEach(function (e) {
|
|
73
|
-
define(t, e, function (t) {
|
|
74
|
-
return this._invoke(e, t);
|
|
75
|
-
});
|
|
76
|
-
});
|
|
5
|
+
var i = n[a](c),
|
|
6
|
+
u = i.value;
|
|
7
|
+
} catch (n) {
|
|
8
|
+
return void e(n);
|
|
77
9
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}) : e.resolve(h).then(function (t) {
|
|
89
|
-
u.value = t, i(u);
|
|
90
|
-
}, function (t) {
|
|
91
|
-
return invoke("throw", t, i, a);
|
|
92
|
-
});
|
|
10
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
11
|
+
}
|
|
12
|
+
function _asyncToGenerator(n) {
|
|
13
|
+
return function () {
|
|
14
|
+
var t = this,
|
|
15
|
+
e = arguments;
|
|
16
|
+
return new Promise(function (r, o) {
|
|
17
|
+
var a = n.apply(t, e);
|
|
18
|
+
function _next(n) {
|
|
19
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
93
20
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var r;
|
|
97
|
-
o(this, "_invoke", {
|
|
98
|
-
value: function (t, n) {
|
|
99
|
-
function callInvokeWithMethodAndArg() {
|
|
100
|
-
return new e(function (e, r) {
|
|
101
|
-
invoke(t, n, e, r);
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
21
|
+
function _throw(n) {
|
|
22
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
105
23
|
}
|
|
24
|
+
_next(void 0);
|
|
106
25
|
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function _extends() {
|
|
29
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
30
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
31
|
+
var t = arguments[e];
|
|
32
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
33
|
+
}
|
|
34
|
+
return n;
|
|
35
|
+
}, _extends.apply(null, arguments);
|
|
36
|
+
}
|
|
37
|
+
function _regenerator() {
|
|
38
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
39
|
+
var e,
|
|
40
|
+
t,
|
|
41
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
42
|
+
n = r.iterator || "@@iterator",
|
|
43
|
+
o = r.toStringTag || "@@toStringTag";
|
|
44
|
+
function i(r, n, o, i) {
|
|
45
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
46
|
+
u = Object.create(c.prototype);
|
|
47
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
48
|
+
var i,
|
|
49
|
+
c,
|
|
50
|
+
u,
|
|
51
|
+
f = 0,
|
|
52
|
+
p = o || [],
|
|
53
|
+
y = !1,
|
|
54
|
+
G = {
|
|
55
|
+
p: 0,
|
|
56
|
+
n: 0,
|
|
57
|
+
v: e,
|
|
58
|
+
a: d,
|
|
59
|
+
f: d.bind(e, 4),
|
|
60
|
+
d: function (t, r) {
|
|
61
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
62
|
+
}
|
|
117
63
|
};
|
|
64
|
+
function d(r, n) {
|
|
65
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
66
|
+
var o,
|
|
67
|
+
i = p[t],
|
|
68
|
+
d = G.p,
|
|
69
|
+
l = i[2];
|
|
70
|
+
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));
|
|
71
|
+
}
|
|
72
|
+
if (o || r > 1) return a;
|
|
73
|
+
throw y = !0, n;
|
|
118
74
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (
|
|
125
|
-
|
|
75
|
+
return function (o, p, l) {
|
|
76
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
77
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
78
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
79
|
+
try {
|
|
80
|
+
if (f = 2, i) {
|
|
81
|
+
if (c || (o = "next"), t = i[o]) {
|
|
82
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
83
|
+
if (!t.done) return t;
|
|
84
|
+
u = t.value, c < 2 && (c = 0);
|
|
85
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
86
|
+
i = e;
|
|
87
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
88
|
+
} catch (t) {
|
|
89
|
+
i = e, c = 1, u = t;
|
|
90
|
+
} finally {
|
|
91
|
+
f = 1;
|
|
126
92
|
}
|
|
127
93
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if ("normal" === p.type) {
|
|
135
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
136
|
-
return {
|
|
137
|
-
value: p.arg,
|
|
138
|
-
done: n.done
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
function maybeInvokeDelegate(e, r) {
|
|
146
|
-
var n = r.method,
|
|
147
|
-
o = e.iterator[n];
|
|
148
|
-
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;
|
|
149
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
150
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
151
|
-
var a = i.arg;
|
|
152
|
-
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);
|
|
153
|
-
}
|
|
154
|
-
function pushTryEntry(t) {
|
|
155
|
-
var e = {
|
|
156
|
-
tryLoc: t[0]
|
|
157
|
-
};
|
|
158
|
-
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
159
|
-
}
|
|
160
|
-
function resetTryEntry(t) {
|
|
161
|
-
var e = t.completion || {};
|
|
162
|
-
e.type = "normal", delete e.arg, t.completion = e;
|
|
163
|
-
}
|
|
164
|
-
function Context(t) {
|
|
165
|
-
this.tryEntries = [{
|
|
166
|
-
tryLoc: "root"
|
|
167
|
-
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
94
|
+
return {
|
|
95
|
+
value: t,
|
|
96
|
+
done: y
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
}(r, o, i), !0), u;
|
|
168
100
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
return i.next = i;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
throw new TypeError(typeof e + " is not iterable");
|
|
101
|
+
var a = {};
|
|
102
|
+
function Generator() {}
|
|
103
|
+
function GeneratorFunction() {}
|
|
104
|
+
function GeneratorFunctionPrototype() {}
|
|
105
|
+
t = Object.getPrototypeOf;
|
|
106
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
107
|
+
return this;
|
|
108
|
+
}), t),
|
|
109
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
110
|
+
function f(e) {
|
|
111
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
184
112
|
}
|
|
185
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
186
|
-
value: GeneratorFunctionPrototype,
|
|
187
|
-
configurable: !0
|
|
188
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
189
|
-
value: GeneratorFunction,
|
|
190
|
-
configurable: !0
|
|
191
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
192
|
-
var e = "function" == typeof t && t.constructor;
|
|
193
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
194
|
-
}, e.mark = function (t) {
|
|
195
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
196
|
-
}, e.awrap = function (t) {
|
|
197
|
-
return {
|
|
198
|
-
__await: t
|
|
199
|
-
};
|
|
200
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
201
|
-
return this;
|
|
202
|
-
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
203
|
-
void 0 === i && (i = Promise);
|
|
204
|
-
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
205
|
-
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
206
|
-
return t.done ? t.value : a.next();
|
|
207
|
-
});
|
|
208
|
-
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
113
|
+
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 () {
|
|
209
114
|
return this;
|
|
210
|
-
}),
|
|
115
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
211
116
|
return "[object Generator]";
|
|
212
|
-
}),
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
return r.reverse(), function next() {
|
|
217
|
-
for (; r.length;) {
|
|
218
|
-
var t = r.pop();
|
|
219
|
-
if (t in e) return next.value = t, next.done = !1, next;
|
|
220
|
-
}
|
|
221
|
-
return next.done = !0, next;
|
|
117
|
+
}), (_regenerator = function () {
|
|
118
|
+
return {
|
|
119
|
+
w: i,
|
|
120
|
+
m: f
|
|
222
121
|
};
|
|
223
|
-
}
|
|
224
|
-
constructor: Context,
|
|
225
|
-
reset: function (e) {
|
|
226
|
-
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);
|
|
227
|
-
},
|
|
228
|
-
stop: function () {
|
|
229
|
-
this.done = !0;
|
|
230
|
-
var t = this.tryEntries[0].completion;
|
|
231
|
-
if ("throw" === t.type) throw t.arg;
|
|
232
|
-
return this.rval;
|
|
233
|
-
},
|
|
234
|
-
dispatchException: function (e) {
|
|
235
|
-
if (this.done) throw e;
|
|
236
|
-
var r = this;
|
|
237
|
-
function handle(n, o) {
|
|
238
|
-
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
239
|
-
}
|
|
240
|
-
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
241
|
-
var i = this.tryEntries[o],
|
|
242
|
-
a = i.completion;
|
|
243
|
-
if ("root" === i.tryLoc) return handle("end");
|
|
244
|
-
if (i.tryLoc <= this.prev) {
|
|
245
|
-
var c = n.call(i, "catchLoc"),
|
|
246
|
-
u = n.call(i, "finallyLoc");
|
|
247
|
-
if (c && u) {
|
|
248
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
249
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
250
|
-
} else if (c) {
|
|
251
|
-
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
252
|
-
} else {
|
|
253
|
-
if (!u) throw new Error("try statement without catch or finally");
|
|
254
|
-
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
abrupt: function (t, e) {
|
|
260
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
261
|
-
var o = this.tryEntries[r];
|
|
262
|
-
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
263
|
-
var i = o;
|
|
264
|
-
break;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
268
|
-
var a = i ? i.completion : {};
|
|
269
|
-
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
270
|
-
},
|
|
271
|
-
complete: function (t, e) {
|
|
272
|
-
if ("throw" === t.type) throw t.arg;
|
|
273
|
-
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;
|
|
274
|
-
},
|
|
275
|
-
finish: function (t) {
|
|
276
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
277
|
-
var r = this.tryEntries[e];
|
|
278
|
-
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
catch: function (t) {
|
|
282
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
283
|
-
var r = this.tryEntries[e];
|
|
284
|
-
if (r.tryLoc === t) {
|
|
285
|
-
var n = r.completion;
|
|
286
|
-
if ("throw" === n.type) {
|
|
287
|
-
var o = n.arg;
|
|
288
|
-
resetTryEntry(r);
|
|
289
|
-
}
|
|
290
|
-
return o;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
throw new Error("illegal catch attempt");
|
|
294
|
-
},
|
|
295
|
-
delegateYield: function (e, r, n) {
|
|
296
|
-
return this.delegate = {
|
|
297
|
-
iterator: values(e),
|
|
298
|
-
resultName: r,
|
|
299
|
-
nextLoc: n
|
|
300
|
-
}, "next" === this.method && (this.arg = t), y;
|
|
301
|
-
}
|
|
302
|
-
}, e;
|
|
122
|
+
})();
|
|
303
123
|
}
|
|
304
|
-
function
|
|
124
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
125
|
+
var i = Object.defineProperty;
|
|
305
126
|
try {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
reject(error);
|
|
310
|
-
return;
|
|
127
|
+
i({}, "", {});
|
|
128
|
+
} catch (e) {
|
|
129
|
+
i = 0;
|
|
311
130
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
}
|
|
318
|
-
function _asyncToGenerator(fn) {
|
|
319
|
-
return function () {
|
|
320
|
-
var self = this,
|
|
321
|
-
args = arguments;
|
|
322
|
-
return new Promise(function (resolve, reject) {
|
|
323
|
-
var gen = fn.apply(self, args);
|
|
324
|
-
function _next(value) {
|
|
325
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
326
|
-
}
|
|
327
|
-
function _throw(err) {
|
|
328
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
329
|
-
}
|
|
330
|
-
_next(undefined);
|
|
331
|
-
});
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
function _extends() {
|
|
335
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
336
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
337
|
-
var source = arguments[i];
|
|
338
|
-
for (var key in source) {
|
|
339
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
340
|
-
target[key] = source[key];
|
|
341
|
-
}
|
|
342
|
-
}
|
|
131
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
132
|
+
function o(r, n) {
|
|
133
|
+
_regeneratorDefine(e, r, function (e) {
|
|
134
|
+
return this._invoke(r, n, e);
|
|
135
|
+
});
|
|
343
136
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
137
|
+
r ? i ? i(e, r, {
|
|
138
|
+
value: n,
|
|
139
|
+
enumerable: !t,
|
|
140
|
+
configurable: !t,
|
|
141
|
+
writable: !t
|
|
142
|
+
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
|
|
143
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
347
144
|
}
|
|
348
145
|
|
|
349
146
|
var initialDauthState = {
|
|
@@ -457,10 +254,10 @@ function getClientBasePath() {
|
|
|
457
254
|
}
|
|
458
255
|
|
|
459
256
|
var getUserAPI = /*#__PURE__*/function () {
|
|
460
|
-
var _ref = /*#__PURE__*/_asyncToGenerator(
|
|
257
|
+
var _ref = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(domainName, token) {
|
|
461
258
|
var params, response, data;
|
|
462
|
-
return
|
|
463
|
-
while (1) switch (_context.
|
|
259
|
+
return _regenerator().w(function (_context) {
|
|
260
|
+
while (1) switch (_context.n) {
|
|
464
261
|
case 0:
|
|
465
262
|
params = {
|
|
466
263
|
method: 'GET',
|
|
@@ -469,21 +266,18 @@ var getUserAPI = /*#__PURE__*/function () {
|
|
|
469
266
|
'Content-Type': 'application/json'
|
|
470
267
|
}
|
|
471
268
|
};
|
|
472
|
-
_context.
|
|
269
|
+
_context.n = 1;
|
|
473
270
|
return fetch(getServerBasePath() + "/app/" + domainName + "/user", params);
|
|
474
|
-
case
|
|
475
|
-
response = _context.
|
|
476
|
-
_context.
|
|
271
|
+
case 1:
|
|
272
|
+
response = _context.v;
|
|
273
|
+
_context.n = 2;
|
|
477
274
|
return response.json();
|
|
478
|
-
case
|
|
479
|
-
data = _context.
|
|
480
|
-
return _context.
|
|
275
|
+
case 2:
|
|
276
|
+
data = _context.v;
|
|
277
|
+
return _context.a(2, {
|
|
481
278
|
response: response,
|
|
482
279
|
data: data
|
|
483
280
|
});
|
|
484
|
-
case 8:
|
|
485
|
-
case "end":
|
|
486
|
-
return _context.stop();
|
|
487
281
|
}
|
|
488
282
|
}, _callee);
|
|
489
283
|
}));
|
|
@@ -492,10 +286,10 @@ var getUserAPI = /*#__PURE__*/function () {
|
|
|
492
286
|
};
|
|
493
287
|
}();
|
|
494
288
|
var updateUserAPI = /*#__PURE__*/function () {
|
|
495
|
-
var _ref2 = /*#__PURE__*/_asyncToGenerator(
|
|
289
|
+
var _ref2 = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(domainName, user, token) {
|
|
496
290
|
var params, response, data;
|
|
497
|
-
return
|
|
498
|
-
while (1) switch (_context2.
|
|
291
|
+
return _regenerator().w(function (_context2) {
|
|
292
|
+
while (1) switch (_context2.n) {
|
|
499
293
|
case 0:
|
|
500
294
|
params = {
|
|
501
295
|
method: 'PATCH',
|
|
@@ -505,21 +299,18 @@ var updateUserAPI = /*#__PURE__*/function () {
|
|
|
505
299
|
},
|
|
506
300
|
body: JSON.stringify(user)
|
|
507
301
|
};
|
|
508
|
-
_context2.
|
|
302
|
+
_context2.n = 1;
|
|
509
303
|
return fetch(getServerBasePath() + "/app/" + domainName + "/user", params);
|
|
510
|
-
case
|
|
511
|
-
response = _context2.
|
|
512
|
-
_context2.
|
|
304
|
+
case 1:
|
|
305
|
+
response = _context2.v;
|
|
306
|
+
_context2.n = 2;
|
|
513
307
|
return response.json();
|
|
514
|
-
case
|
|
515
|
-
data = _context2.
|
|
516
|
-
return _context2.
|
|
308
|
+
case 2:
|
|
309
|
+
data = _context2.v;
|
|
310
|
+
return _context2.a(2, {
|
|
517
311
|
response: response,
|
|
518
312
|
data: data
|
|
519
313
|
});
|
|
520
|
-
case 8:
|
|
521
|
-
case "end":
|
|
522
|
-
return _context2.stop();
|
|
523
314
|
}
|
|
524
315
|
}, _callee2);
|
|
525
316
|
}));
|
|
@@ -528,10 +319,10 @@ var updateUserAPI = /*#__PURE__*/function () {
|
|
|
528
319
|
};
|
|
529
320
|
}();
|
|
530
321
|
var sendEmailVerificationAPI = /*#__PURE__*/function () {
|
|
531
|
-
var _ref3 = /*#__PURE__*/_asyncToGenerator(
|
|
322
|
+
var _ref3 = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(domainName, token) {
|
|
532
323
|
var params, response, data;
|
|
533
|
-
return
|
|
534
|
-
while (1) switch (_context3.
|
|
324
|
+
return _regenerator().w(function (_context3) {
|
|
325
|
+
while (1) switch (_context3.n) {
|
|
535
326
|
case 0:
|
|
536
327
|
params = {
|
|
537
328
|
method: 'GET',
|
|
@@ -540,21 +331,18 @@ var sendEmailVerificationAPI = /*#__PURE__*/function () {
|
|
|
540
331
|
'Content-Type': 'application/json'
|
|
541
332
|
}
|
|
542
333
|
};
|
|
543
|
-
_context3.
|
|
334
|
+
_context3.n = 1;
|
|
544
335
|
return fetch(getServerBasePath() + "/app/" + domainName + "/resend-email-verification", params);
|
|
545
|
-
case
|
|
546
|
-
response = _context3.
|
|
547
|
-
_context3.
|
|
336
|
+
case 1:
|
|
337
|
+
response = _context3.v;
|
|
338
|
+
_context3.n = 2;
|
|
548
339
|
return response.json();
|
|
549
|
-
case
|
|
550
|
-
data = _context3.
|
|
551
|
-
return _context3.
|
|
340
|
+
case 2:
|
|
341
|
+
data = _context3.v;
|
|
342
|
+
return _context3.a(2, {
|
|
552
343
|
response: response,
|
|
553
344
|
data: data
|
|
554
345
|
});
|
|
555
|
-
case 8:
|
|
556
|
-
case "end":
|
|
557
|
-
return _context3.stop();
|
|
558
346
|
}
|
|
559
347
|
}, _callee3);
|
|
560
348
|
}));
|
|
@@ -563,10 +351,10 @@ var sendEmailVerificationAPI = /*#__PURE__*/function () {
|
|
|
563
351
|
};
|
|
564
352
|
}();
|
|
565
353
|
var refreshAccessTokenAPI = /*#__PURE__*/function () {
|
|
566
|
-
var _ref4 = /*#__PURE__*/_asyncToGenerator(
|
|
354
|
+
var _ref4 = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(domainName, token) {
|
|
567
355
|
var params, response, data;
|
|
568
|
-
return
|
|
569
|
-
while (1) switch (_context4.
|
|
356
|
+
return _regenerator().w(function (_context4) {
|
|
357
|
+
while (1) switch (_context4.n) {
|
|
570
358
|
case 0:
|
|
571
359
|
params = {
|
|
572
360
|
method: 'GET',
|
|
@@ -575,21 +363,18 @@ var refreshAccessTokenAPI = /*#__PURE__*/function () {
|
|
|
575
363
|
'Content-Type': 'application/json'
|
|
576
364
|
}
|
|
577
365
|
};
|
|
578
|
-
_context4.
|
|
366
|
+
_context4.n = 1;
|
|
579
367
|
return fetch(getServerBasePath() + "/app/" + domainName + "/refresh-access-token", params);
|
|
580
|
-
case
|
|
581
|
-
response = _context4.
|
|
582
|
-
_context4.
|
|
368
|
+
case 1:
|
|
369
|
+
response = _context4.v;
|
|
370
|
+
_context4.n = 2;
|
|
583
371
|
return response.json();
|
|
584
|
-
case
|
|
585
|
-
data = _context4.
|
|
586
|
-
return _context4.
|
|
372
|
+
case 2:
|
|
373
|
+
data = _context4.v;
|
|
374
|
+
return _context4.a(2, {
|
|
587
375
|
response: response,
|
|
588
376
|
data: data
|
|
589
377
|
});
|
|
590
|
-
case 8:
|
|
591
|
-
case "end":
|
|
592
|
-
return _context4.stop();
|
|
593
378
|
}
|
|
594
379
|
}, _callee4);
|
|
595
380
|
}));
|
|
@@ -598,10 +383,10 @@ var refreshAccessTokenAPI = /*#__PURE__*/function () {
|
|
|
598
383
|
};
|
|
599
384
|
}();
|
|
600
385
|
var verifyTokenAPI = /*#__PURE__*/function () {
|
|
601
|
-
var _ref6 = /*#__PURE__*/_asyncToGenerator(
|
|
386
|
+
var _ref6 = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(_ref5) {
|
|
602
387
|
var domainName, tsk, token, params, response, data;
|
|
603
|
-
return
|
|
604
|
-
while (1) switch (_context5.
|
|
388
|
+
return _regenerator().w(function (_context5) {
|
|
389
|
+
while (1) switch (_context5.n) {
|
|
605
390
|
case 0:
|
|
606
391
|
domainName = _ref5.domainName, tsk = _ref5.tsk, token = _ref5.token;
|
|
607
392
|
params = {
|
|
@@ -614,25 +399,22 @@ var verifyTokenAPI = /*#__PURE__*/function () {
|
|
|
614
399
|
tsk: tsk
|
|
615
400
|
})
|
|
616
401
|
};
|
|
617
|
-
_context5.
|
|
402
|
+
_context5.n = 1;
|
|
618
403
|
return fetch(getServerBasePath() + "/app/" + domainName + "/verify-token", params);
|
|
619
|
-
case
|
|
620
|
-
response = _context5.
|
|
621
|
-
_context5.
|
|
404
|
+
case 1:
|
|
405
|
+
response = _context5.v;
|
|
406
|
+
_context5.n = 2;
|
|
622
407
|
return response.json();
|
|
623
|
-
case
|
|
624
|
-
data = _context5.
|
|
625
|
-
return _context5.
|
|
408
|
+
case 2:
|
|
409
|
+
data = _context5.v;
|
|
410
|
+
return _context5.a(2, {
|
|
626
411
|
response: response,
|
|
627
412
|
data: data
|
|
628
413
|
});
|
|
629
|
-
case 9:
|
|
630
|
-
case "end":
|
|
631
|
-
return _context5.stop();
|
|
632
414
|
}
|
|
633
415
|
}, _callee5);
|
|
634
416
|
}));
|
|
635
|
-
return function verifyTokenAPI(
|
|
417
|
+
return function verifyTokenAPI(_x0) {
|
|
636
418
|
return _ref6.apply(this, arguments);
|
|
637
419
|
};
|
|
638
420
|
}();
|
|
@@ -648,10 +430,10 @@ function setDauthStateAction(_x) {
|
|
|
648
430
|
return _setDauthStateAction.apply(this, arguments);
|
|
649
431
|
}
|
|
650
432
|
function _setDauthStateAction() {
|
|
651
|
-
_setDauthStateAction = _asyncToGenerator(
|
|
652
|
-
var dispatch, token, domainName, getUserFetch;
|
|
653
|
-
return
|
|
654
|
-
while (1) switch (_context.
|
|
433
|
+
_setDauthStateAction = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
|
|
434
|
+
var dispatch, token, domainName, getUserFetch, _t;
|
|
435
|
+
return _regenerator().w(function (_context) {
|
|
436
|
+
while (1) switch (_context.p = _context.n) {
|
|
655
437
|
case 0:
|
|
656
438
|
dispatch = _ref.dispatch, token = _ref.token, domainName = _ref.domainName;
|
|
657
439
|
dispatch({
|
|
@@ -660,13 +442,13 @@ function _setDauthStateAction() {
|
|
|
660
442
|
isLoading: true
|
|
661
443
|
}
|
|
662
444
|
});
|
|
663
|
-
_context.
|
|
664
|
-
_context.
|
|
445
|
+
_context.p = 1;
|
|
446
|
+
_context.n = 2;
|
|
665
447
|
return getUserAPI(domainName, token);
|
|
666
|
-
case
|
|
667
|
-
getUserFetch = _context.
|
|
448
|
+
case 2:
|
|
449
|
+
getUserFetch = _context.v;
|
|
668
450
|
if (!(getUserFetch.response.status === 200)) {
|
|
669
|
-
_context.
|
|
451
|
+
_context.n = 3;
|
|
670
452
|
break;
|
|
671
453
|
}
|
|
672
454
|
dispatch({
|
|
@@ -677,32 +459,31 @@ function _setDauthStateAction() {
|
|
|
677
459
|
isAuthenticated: true
|
|
678
460
|
}
|
|
679
461
|
});
|
|
680
|
-
window.history.replaceState({}, document.title,
|
|
681
|
-
return _context.
|
|
682
|
-
case
|
|
683
|
-
return _context.
|
|
684
|
-
case
|
|
685
|
-
_context.
|
|
462
|
+
window.history.replaceState({}, document.title, window.location.pathname);
|
|
463
|
+
return _context.a(2, localStorage.setItem(TOKEN_LS, token));
|
|
464
|
+
case 3:
|
|
465
|
+
return _context.a(2, resetUser(dispatch));
|
|
466
|
+
case 4:
|
|
467
|
+
_context.n = 6;
|
|
686
468
|
break;
|
|
687
|
-
case
|
|
688
|
-
_context.
|
|
689
|
-
|
|
690
|
-
console.error(
|
|
691
|
-
return _context.
|
|
692
|
-
case
|
|
693
|
-
_context.
|
|
469
|
+
case 5:
|
|
470
|
+
_context.p = 5;
|
|
471
|
+
_t = _context.v;
|
|
472
|
+
console.error(_t);
|
|
473
|
+
return _context.a(2, resetUser(dispatch));
|
|
474
|
+
case 6:
|
|
475
|
+
_context.p = 6;
|
|
694
476
|
dispatch({
|
|
695
477
|
type: SET_IS_LOADING,
|
|
696
478
|
payload: {
|
|
697
479
|
isLoading: false
|
|
698
480
|
}
|
|
699
481
|
});
|
|
700
|
-
return _context.
|
|
701
|
-
case
|
|
702
|
-
|
|
703
|
-
return _context.stop();
|
|
482
|
+
return _context.f(6);
|
|
483
|
+
case 7:
|
|
484
|
+
return _context.a(2);
|
|
704
485
|
}
|
|
705
|
-
}, _callee, null, [[
|
|
486
|
+
}, _callee, null, [[1, 5, 6, 7]]);
|
|
706
487
|
}));
|
|
707
488
|
return _setDauthStateAction.apply(this, arguments);
|
|
708
489
|
}
|
|
@@ -710,10 +491,10 @@ function setAutoLoginAction(_x2) {
|
|
|
710
491
|
return _setAutoLoginAction.apply(this, arguments);
|
|
711
492
|
}
|
|
712
493
|
function _setAutoLoginAction() {
|
|
713
|
-
_setAutoLoginAction = _asyncToGenerator(
|
|
714
|
-
var dispatch, token_ls, domainName, refreshAccessTokenFetch, newToken, getUserFetch;
|
|
715
|
-
return
|
|
716
|
-
while (1) switch (_context2.
|
|
494
|
+
_setAutoLoginAction = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref2) {
|
|
495
|
+
var dispatch, token_ls, domainName, refreshAccessTokenFetch, newToken, getUserFetch, _t2;
|
|
496
|
+
return _regenerator().w(function (_context2) {
|
|
497
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
717
498
|
case 0:
|
|
718
499
|
dispatch = _ref2.dispatch, token_ls = _ref2.token_ls, domainName = _ref2.domainName;
|
|
719
500
|
dispatch({
|
|
@@ -722,22 +503,22 @@ function _setAutoLoginAction() {
|
|
|
722
503
|
isLoading: true
|
|
723
504
|
}
|
|
724
505
|
});
|
|
725
|
-
_context2.
|
|
726
|
-
_context2.
|
|
506
|
+
_context2.p = 1;
|
|
507
|
+
_context2.n = 2;
|
|
727
508
|
return refreshAccessTokenAPI(domainName, token_ls);
|
|
728
|
-
case
|
|
729
|
-
refreshAccessTokenFetch = _context2.
|
|
509
|
+
case 2:
|
|
510
|
+
refreshAccessTokenFetch = _context2.v;
|
|
730
511
|
if (!(refreshAccessTokenFetch.response.status === 200)) {
|
|
731
|
-
_context2.
|
|
512
|
+
_context2.n = 6;
|
|
732
513
|
break;
|
|
733
514
|
}
|
|
734
515
|
newToken = refreshAccessTokenFetch.data.accessToken || token_ls;
|
|
735
|
-
_context2.
|
|
516
|
+
_context2.n = 3;
|
|
736
517
|
return getUserAPI(domainName, newToken);
|
|
737
|
-
case
|
|
738
|
-
getUserFetch = _context2.
|
|
518
|
+
case 3:
|
|
519
|
+
getUserFetch = _context2.v;
|
|
739
520
|
if (!(getUserFetch.response.status === 200)) {
|
|
740
|
-
_context2.
|
|
521
|
+
_context2.n = 4;
|
|
741
522
|
break;
|
|
742
523
|
}
|
|
743
524
|
dispatch({
|
|
@@ -749,38 +530,37 @@ function _setAutoLoginAction() {
|
|
|
749
530
|
}
|
|
750
531
|
});
|
|
751
532
|
localStorage.setItem(TOKEN_LS, refreshAccessTokenFetch.data.accessToken);
|
|
752
|
-
return _context2.
|
|
753
|
-
case
|
|
533
|
+
return _context2.a(2);
|
|
534
|
+
case 4:
|
|
754
535
|
window.location.replace(getClientBasePath() + "/" + domainName + "/" + routes.signin);
|
|
755
|
-
return _context2.
|
|
756
|
-
case
|
|
757
|
-
_context2.
|
|
536
|
+
return _context2.a(2, resetUser(dispatch));
|
|
537
|
+
case 5:
|
|
538
|
+
_context2.n = 7;
|
|
758
539
|
break;
|
|
759
|
-
case
|
|
540
|
+
case 6:
|
|
760
541
|
window.location.replace(getClientBasePath() + "/" + domainName + "/" + routes.signin);
|
|
761
|
-
return _context2.
|
|
762
|
-
case
|
|
763
|
-
_context2.
|
|
542
|
+
return _context2.a(2, resetUser(dispatch));
|
|
543
|
+
case 7:
|
|
544
|
+
_context2.n = 9;
|
|
764
545
|
break;
|
|
765
|
-
case
|
|
766
|
-
_context2.
|
|
767
|
-
|
|
768
|
-
console.error(
|
|
769
|
-
return _context2.
|
|
770
|
-
case
|
|
771
|
-
_context2.
|
|
546
|
+
case 8:
|
|
547
|
+
_context2.p = 8;
|
|
548
|
+
_t2 = _context2.v;
|
|
549
|
+
console.error(_t2);
|
|
550
|
+
return _context2.a(2, resetUser(dispatch));
|
|
551
|
+
case 9:
|
|
552
|
+
_context2.p = 9;
|
|
772
553
|
dispatch({
|
|
773
554
|
type: SET_IS_LOADING,
|
|
774
555
|
payload: {
|
|
775
556
|
isLoading: false
|
|
776
557
|
}
|
|
777
558
|
});
|
|
778
|
-
return _context2.
|
|
779
|
-
case
|
|
780
|
-
|
|
781
|
-
return _context2.stop();
|
|
559
|
+
return _context2.f(9);
|
|
560
|
+
case 10:
|
|
561
|
+
return _context2.a(2);
|
|
782
562
|
}
|
|
783
|
-
}, _callee2, null, [[
|
|
563
|
+
}, _callee2, null, [[1, 8, 9, 10]]);
|
|
784
564
|
}));
|
|
785
565
|
return _setAutoLoginAction.apply(this, arguments);
|
|
786
566
|
}
|
|
@@ -814,55 +594,54 @@ function setUpdateUserAction(_x3) {
|
|
|
814
594
|
return _setUpdateUserAction.apply(this, arguments);
|
|
815
595
|
}
|
|
816
596
|
function _setUpdateUserAction() {
|
|
817
|
-
_setUpdateUserAction = _asyncToGenerator(
|
|
818
|
-
var dispatch, domainName, user, token, getUserFetch;
|
|
819
|
-
return
|
|
820
|
-
while (1) switch (_context3.
|
|
597
|
+
_setUpdateUserAction = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref4) {
|
|
598
|
+
var dispatch, domainName, user, token, getUserFetch, _t3;
|
|
599
|
+
return _regenerator().w(function (_context3) {
|
|
600
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
821
601
|
case 0:
|
|
822
602
|
dispatch = _ref4.dispatch, domainName = _ref4.domainName, user = _ref4.user, token = _ref4.token;
|
|
823
603
|
if (user.language) {
|
|
824
604
|
window.document.documentElement.setAttribute('lang', user.language);
|
|
825
605
|
}
|
|
826
606
|
if (token) {
|
|
827
|
-
_context3.
|
|
607
|
+
_context3.n = 1;
|
|
828
608
|
break;
|
|
829
609
|
}
|
|
830
610
|
dispatch({
|
|
831
611
|
type: UPDATE_USER,
|
|
832
612
|
payload: user
|
|
833
613
|
});
|
|
834
|
-
return _context3.
|
|
835
|
-
case
|
|
836
|
-
_context3.
|
|
837
|
-
_context3.
|
|
614
|
+
return _context3.a(2, false);
|
|
615
|
+
case 1:
|
|
616
|
+
_context3.p = 1;
|
|
617
|
+
_context3.n = 2;
|
|
838
618
|
return updateUserAPI(domainName, user, token);
|
|
839
|
-
case
|
|
840
|
-
getUserFetch = _context3.
|
|
619
|
+
case 2:
|
|
620
|
+
getUserFetch = _context3.v;
|
|
841
621
|
if (!(getUserFetch.response.status === 200)) {
|
|
842
|
-
_context3.
|
|
622
|
+
_context3.n = 3;
|
|
843
623
|
break;
|
|
844
624
|
}
|
|
845
625
|
dispatch({
|
|
846
626
|
type: UPDATE_USER,
|
|
847
627
|
payload: getUserFetch.data.user
|
|
848
628
|
});
|
|
849
|
-
return _context3.
|
|
850
|
-
case
|
|
629
|
+
return _context3.a(2, true);
|
|
630
|
+
case 3:
|
|
851
631
|
console.error('Update user error', getUserFetch.data.message);
|
|
852
|
-
return _context3.
|
|
853
|
-
case
|
|
854
|
-
_context3.
|
|
632
|
+
return _context3.a(2, false);
|
|
633
|
+
case 4:
|
|
634
|
+
_context3.n = 6;
|
|
855
635
|
break;
|
|
856
|
-
case
|
|
857
|
-
_context3.
|
|
858
|
-
|
|
859
|
-
console.error('Update user error',
|
|
860
|
-
return _context3.
|
|
861
|
-
case
|
|
862
|
-
|
|
863
|
-
return _context3.stop();
|
|
636
|
+
case 5:
|
|
637
|
+
_context3.p = 5;
|
|
638
|
+
_t3 = _context3.v;
|
|
639
|
+
console.error('Update user error', _t3);
|
|
640
|
+
return _context3.a(2, false);
|
|
641
|
+
case 6:
|
|
642
|
+
return _context3.a(2);
|
|
864
643
|
}
|
|
865
|
-
}, _callee3, null, [[
|
|
644
|
+
}, _callee3, null, [[1, 5]]);
|
|
866
645
|
}));
|
|
867
646
|
return _setUpdateUserAction.apply(this, arguments);
|
|
868
647
|
}
|
|
@@ -870,10 +649,10 @@ function sendEmailVerificationAction(_x4) {
|
|
|
870
649
|
return _sendEmailVerificationAction.apply(this, arguments);
|
|
871
650
|
}
|
|
872
651
|
function _sendEmailVerificationAction() {
|
|
873
|
-
_sendEmailVerificationAction = _asyncToGenerator(
|
|
652
|
+
_sendEmailVerificationAction = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(_ref5) {
|
|
874
653
|
var dispatch, domainName, token, sendEmailFetch;
|
|
875
|
-
return
|
|
876
|
-
while (1) switch (_context4.
|
|
654
|
+
return _regenerator().w(function (_context4) {
|
|
655
|
+
while (1) switch (_context4.p = _context4.n) {
|
|
877
656
|
case 0:
|
|
878
657
|
dispatch = _ref5.dispatch, domainName = _ref5.domainName, token = _ref5.token;
|
|
879
658
|
dispatch({
|
|
@@ -887,13 +666,13 @@ function _sendEmailVerificationAction() {
|
|
|
887
666
|
message: 'Sending email verification...'
|
|
888
667
|
}
|
|
889
668
|
});
|
|
890
|
-
_context4.
|
|
891
|
-
_context4.
|
|
669
|
+
_context4.p = 1;
|
|
670
|
+
_context4.n = 2;
|
|
892
671
|
return sendEmailVerificationAPI(domainName, token);
|
|
893
|
-
case
|
|
894
|
-
sendEmailFetch = _context4.
|
|
672
|
+
case 2:
|
|
673
|
+
sendEmailFetch = _context4.v;
|
|
895
674
|
if (!(sendEmailFetch.response.status === 200)) {
|
|
896
|
-
_context4.
|
|
675
|
+
_context4.n = 3;
|
|
897
676
|
break;
|
|
898
677
|
}
|
|
899
678
|
dispatch({
|
|
@@ -907,8 +686,8 @@ function _sendEmailVerificationAction() {
|
|
|
907
686
|
type: SET_SEND_EMAIL_VERIFICATION_IS_LOADING,
|
|
908
687
|
payload: false
|
|
909
688
|
});
|
|
910
|
-
return _context4.
|
|
911
|
-
case
|
|
689
|
+
return _context4.a(2, true);
|
|
690
|
+
case 3:
|
|
912
691
|
dispatch({
|
|
913
692
|
type: SET_SEND_EMAIL_VERIFICATION_STATUS,
|
|
914
693
|
payload: {
|
|
@@ -920,13 +699,12 @@ function _sendEmailVerificationAction() {
|
|
|
920
699
|
type: SET_SEND_EMAIL_VERIFICATION_IS_LOADING,
|
|
921
700
|
payload: false
|
|
922
701
|
});
|
|
923
|
-
return _context4.
|
|
924
|
-
case
|
|
925
|
-
_context4.
|
|
702
|
+
return _context4.a(2, false);
|
|
703
|
+
case 4:
|
|
704
|
+
_context4.n = 6;
|
|
926
705
|
break;
|
|
927
|
-
case
|
|
928
|
-
_context4.
|
|
929
|
-
_context4.t0 = _context4["catch"](3);
|
|
706
|
+
case 5:
|
|
707
|
+
_context4.p = 5;
|
|
930
708
|
dispatch({
|
|
931
709
|
type: SET_SEND_EMAIL_VERIFICATION_STATUS,
|
|
932
710
|
payload: {
|
|
@@ -938,12 +716,11 @@ function _sendEmailVerificationAction() {
|
|
|
938
716
|
type: SET_SEND_EMAIL_VERIFICATION_IS_LOADING,
|
|
939
717
|
payload: false
|
|
940
718
|
});
|
|
941
|
-
return _context4.
|
|
942
|
-
case
|
|
943
|
-
|
|
944
|
-
return _context4.stop();
|
|
719
|
+
return _context4.a(2, false);
|
|
720
|
+
case 6:
|
|
721
|
+
return _context4.a(2);
|
|
945
722
|
}
|
|
946
|
-
}, _callee4, null, [[
|
|
723
|
+
}, _callee4, null, [[1, 5]]);
|
|
947
724
|
}));
|
|
948
725
|
return _sendEmailVerificationAction.apply(this, arguments);
|
|
949
726
|
}
|
|
@@ -951,41 +728,40 @@ function checkTokenAction(_x5) {
|
|
|
951
728
|
return _checkTokenAction.apply(this, arguments);
|
|
952
729
|
}
|
|
953
730
|
function _checkTokenAction() {
|
|
954
|
-
_checkTokenAction = _asyncToGenerator(
|
|
955
|
-
var dispatch, domainName, token, refreshAccessTokenFetch;
|
|
956
|
-
return
|
|
957
|
-
while (1) switch (_context5.
|
|
731
|
+
_checkTokenAction = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(_ref6) {
|
|
732
|
+
var dispatch, domainName, token, refreshAccessTokenFetch, _t5;
|
|
733
|
+
return _regenerator().w(function (_context5) {
|
|
734
|
+
while (1) switch (_context5.p = _context5.n) {
|
|
958
735
|
case 0:
|
|
959
736
|
dispatch = _ref6.dispatch, domainName = _ref6.domainName, token = _ref6.token;
|
|
960
|
-
_context5.
|
|
961
|
-
_context5.
|
|
737
|
+
_context5.p = 1;
|
|
738
|
+
_context5.n = 2;
|
|
962
739
|
return refreshAccessTokenAPI(domainName, token);
|
|
963
|
-
case
|
|
964
|
-
refreshAccessTokenFetch = _context5.
|
|
740
|
+
case 2:
|
|
741
|
+
refreshAccessTokenFetch = _context5.v;
|
|
965
742
|
if (!(refreshAccessTokenFetch.response.status === 200)) {
|
|
966
|
-
_context5.
|
|
743
|
+
_context5.n = 3;
|
|
967
744
|
break;
|
|
968
745
|
}
|
|
969
746
|
if (refreshAccessTokenFetch.data.accessToken) {
|
|
970
747
|
localStorage.setItem(TOKEN_LS, refreshAccessTokenFetch.data.accessToken);
|
|
971
748
|
}
|
|
972
|
-
return _context5.
|
|
973
|
-
case
|
|
749
|
+
return _context5.a(2);
|
|
750
|
+
case 3:
|
|
974
751
|
window.location.replace(getClientBasePath() + "/" + domainName + "/" + routes.signin);
|
|
975
|
-
return _context5.
|
|
976
|
-
case
|
|
977
|
-
_context5.
|
|
752
|
+
return _context5.a(2, resetUser(dispatch));
|
|
753
|
+
case 4:
|
|
754
|
+
_context5.n = 6;
|
|
978
755
|
break;
|
|
979
|
-
case
|
|
980
|
-
_context5.
|
|
981
|
-
|
|
756
|
+
case 5:
|
|
757
|
+
_context5.p = 5;
|
|
758
|
+
_t5 = _context5.v;
|
|
982
759
|
resetUser(dispatch);
|
|
983
|
-
throw
|
|
984
|
-
case
|
|
985
|
-
|
|
986
|
-
return _context5.stop();
|
|
760
|
+
throw _t5;
|
|
761
|
+
case 6:
|
|
762
|
+
return _context5.a(2);
|
|
987
763
|
}
|
|
988
|
-
}, _callee5, null, [[1,
|
|
764
|
+
}, _callee5, null, [[1, 5]]);
|
|
989
765
|
}));
|
|
990
766
|
return _checkTokenAction.apply(this, arguments);
|
|
991
767
|
}
|
|
@@ -995,45 +771,44 @@ function getAccessTokenAction(_x6) {
|
|
|
995
771
|
///////////////////////////////////////////
|
|
996
772
|
//////////////////////////////////////////
|
|
997
773
|
function _getAccessTokenAction() {
|
|
998
|
-
_getAccessTokenAction = _asyncToGenerator(
|
|
999
|
-
var dispatch, domainName, token_ls, refreshAccessTokenFetch, _refreshAccessTokenFe;
|
|
1000
|
-
return
|
|
1001
|
-
while (1) switch (_context6.
|
|
774
|
+
_getAccessTokenAction = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(_ref7) {
|
|
775
|
+
var dispatch, domainName, token_ls, refreshAccessTokenFetch, _refreshAccessTokenFe, _t6;
|
|
776
|
+
return _regenerator().w(function (_context6) {
|
|
777
|
+
while (1) switch (_context6.p = _context6.n) {
|
|
1002
778
|
case 0:
|
|
1003
779
|
dispatch = _ref7.dispatch, domainName = _ref7.domainName;
|
|
1004
780
|
token_ls = localStorage.getItem(TOKEN_LS);
|
|
1005
781
|
if (token_ls) {
|
|
1006
|
-
_context6.
|
|
782
|
+
_context6.n = 1;
|
|
1007
783
|
break;
|
|
1008
784
|
}
|
|
1009
|
-
return _context6.
|
|
1010
|
-
case
|
|
1011
|
-
_context6.
|
|
1012
|
-
_context6.
|
|
785
|
+
return _context6.a(2);
|
|
786
|
+
case 1:
|
|
787
|
+
_context6.p = 1;
|
|
788
|
+
_context6.n = 2;
|
|
1013
789
|
return refreshAccessTokenAPI(domainName, token_ls);
|
|
1014
|
-
case
|
|
1015
|
-
refreshAccessTokenFetch = _context6.
|
|
790
|
+
case 2:
|
|
791
|
+
refreshAccessTokenFetch = _context6.v;
|
|
1016
792
|
if (!(refreshAccessTokenFetch.response.status === 200)) {
|
|
1017
|
-
_context6.
|
|
793
|
+
_context6.n = 3;
|
|
1018
794
|
break;
|
|
1019
795
|
}
|
|
1020
|
-
return _context6.
|
|
1021
|
-
case
|
|
796
|
+
return _context6.a(2, (_refreshAccessTokenFe = refreshAccessTokenFetch.data.accessToken) != null ? _refreshAccessTokenFe : token_ls);
|
|
797
|
+
case 3:
|
|
1022
798
|
resetUser(dispatch);
|
|
1023
|
-
return _context6.
|
|
1024
|
-
case
|
|
1025
|
-
_context6.
|
|
799
|
+
return _context6.a(2, 'token-not-found');
|
|
800
|
+
case 4:
|
|
801
|
+
_context6.n = 6;
|
|
1026
802
|
break;
|
|
1027
|
-
case
|
|
1028
|
-
_context6.
|
|
1029
|
-
|
|
803
|
+
case 5:
|
|
804
|
+
_context6.p = 5;
|
|
805
|
+
_t6 = _context6.v;
|
|
1030
806
|
resetUser(dispatch);
|
|
1031
|
-
throw
|
|
1032
|
-
case
|
|
1033
|
-
|
|
1034
|
-
return _context6.stop();
|
|
807
|
+
throw _t6;
|
|
808
|
+
case 6:
|
|
809
|
+
return _context6.a(2);
|
|
1035
810
|
}
|
|
1036
|
-
}, _callee6, null, [[
|
|
811
|
+
}, _callee6, null, [[1, 5]]);
|
|
1037
812
|
}));
|
|
1038
813
|
return _getAccessTokenAction.apply(this, arguments);
|
|
1039
814
|
}
|
|
@@ -1056,37 +831,33 @@ var DauthProvider = function DauthProvider(props) {
|
|
|
1056
831
|
var _useReducer = useReducer(userReducer, initialDauthState),
|
|
1057
832
|
dauthState = _useReducer[0],
|
|
1058
833
|
dispatch = _useReducer[1];
|
|
1059
|
-
var isValidTsk = useCallback(
|
|
1060
|
-
var _ref = _asyncToGenerator(
|
|
834
|
+
var isValidTsk = useCallback(/*#__PURE__*/function () {
|
|
835
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(token) {
|
|
1061
836
|
var verifyToken;
|
|
1062
|
-
return
|
|
1063
|
-
while (1) switch (_context.
|
|
837
|
+
return _regenerator().w(function (_context) {
|
|
838
|
+
while (1) switch (_context.p = _context.n) {
|
|
1064
839
|
case 0:
|
|
1065
|
-
_context.
|
|
1066
|
-
_context.
|
|
840
|
+
_context.p = 0;
|
|
841
|
+
_context.n = 1;
|
|
1067
842
|
return verifyTokenAPI({
|
|
1068
843
|
domainName: domainName,
|
|
1069
844
|
token: token,
|
|
1070
845
|
tsk: tsk
|
|
1071
846
|
});
|
|
1072
|
-
case
|
|
1073
|
-
verifyToken = _context.
|
|
847
|
+
case 1:
|
|
848
|
+
verifyToken = _context.v;
|
|
1074
849
|
if (!(verifyToken.response.status !== 200)) {
|
|
1075
|
-
_context.
|
|
850
|
+
_context.n = 2;
|
|
1076
851
|
break;
|
|
1077
852
|
}
|
|
1078
|
-
return _context.
|
|
1079
|
-
case
|
|
1080
|
-
return _context.
|
|
1081
|
-
case
|
|
1082
|
-
_context.
|
|
1083
|
-
_context.
|
|
1084
|
-
return _context.abrupt("return", false);
|
|
1085
|
-
case 12:
|
|
1086
|
-
case "end":
|
|
1087
|
-
return _context.stop();
|
|
853
|
+
return _context.a(2, false);
|
|
854
|
+
case 2:
|
|
855
|
+
return _context.a(2, true);
|
|
856
|
+
case 3:
|
|
857
|
+
_context.p = 3;
|
|
858
|
+
return _context.a(2, false);
|
|
1088
859
|
}
|
|
1089
|
-
}, _callee, null, [[0,
|
|
860
|
+
}, _callee, null, [[0, 3]]);
|
|
1090
861
|
}));
|
|
1091
862
|
return function (_x) {
|
|
1092
863
|
return _ref.apply(this, arguments);
|
|
@@ -1095,39 +866,38 @@ var DauthProvider = function DauthProvider(props) {
|
|
|
1095
866
|
// Check token periodically
|
|
1096
867
|
useEffect(function () {
|
|
1097
868
|
if (!dauthState.isAuthenticated) return;
|
|
1098
|
-
var interval = setInterval(
|
|
869
|
+
var interval = setInterval(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
1099
870
|
var token_ls, isValid;
|
|
1100
|
-
return
|
|
1101
|
-
while (1) switch (_context2.
|
|
871
|
+
return _regenerator().w(function (_context2) {
|
|
872
|
+
while (1) switch (_context2.n) {
|
|
1102
873
|
case 0:
|
|
1103
874
|
token_ls = localStorage.getItem(TOKEN_LS);
|
|
1104
875
|
if (token_ls) {
|
|
1105
|
-
_context2.
|
|
876
|
+
_context2.n = 1;
|
|
1106
877
|
break;
|
|
1107
878
|
}
|
|
1108
|
-
return _context2.
|
|
1109
|
-
case
|
|
1110
|
-
_context2.
|
|
879
|
+
return _context2.a(2);
|
|
880
|
+
case 1:
|
|
881
|
+
_context2.n = 2;
|
|
1111
882
|
return isValidTsk(token_ls);
|
|
1112
|
-
case
|
|
1113
|
-
isValid = _context2.
|
|
883
|
+
case 2:
|
|
884
|
+
isValid = _context2.v;
|
|
1114
885
|
if (!isValid) {
|
|
1115
|
-
_context2.
|
|
886
|
+
_context2.n = 3;
|
|
1116
887
|
break;
|
|
1117
888
|
}
|
|
1118
|
-
return _context2.
|
|
889
|
+
return _context2.a(2, checkTokenAction({
|
|
1119
890
|
dispatch: dispatch,
|
|
1120
891
|
domainName: domainName,
|
|
1121
892
|
token: token_ls
|
|
1122
893
|
}));
|
|
1123
|
-
case
|
|
894
|
+
case 3:
|
|
1124
895
|
setLogoutAction({
|
|
1125
896
|
dispatch: dispatch
|
|
1126
897
|
});
|
|
1127
898
|
throw new Error('Ask value in DauthProvider is not valid');
|
|
1128
|
-
case
|
|
1129
|
-
|
|
1130
|
-
return _context2.stop();
|
|
899
|
+
case 4:
|
|
900
|
+
return _context2.a(2);
|
|
1131
901
|
}
|
|
1132
902
|
}, _callee2);
|
|
1133
903
|
})), 1000 * 60 * 5);
|
|
@@ -1137,92 +907,90 @@ var DauthProvider = function DauthProvider(props) {
|
|
|
1137
907
|
}, [dauthState.isAuthenticated, isValidTsk]);
|
|
1138
908
|
// Catch login redirect
|
|
1139
909
|
useEffect(function () {
|
|
1140
|
-
_asyncToGenerator(
|
|
910
|
+
_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
1141
911
|
var queryString, urlParams, token_url, isValid;
|
|
1142
|
-
return
|
|
1143
|
-
while (1) switch (_context3.
|
|
912
|
+
return _regenerator().w(function (_context3) {
|
|
913
|
+
while (1) switch (_context3.n) {
|
|
1144
914
|
case 0:
|
|
1145
915
|
queryString = window.location.search;
|
|
1146
916
|
if (queryString) {
|
|
1147
|
-
_context3.
|
|
917
|
+
_context3.n = 1;
|
|
1148
918
|
break;
|
|
1149
919
|
}
|
|
1150
|
-
return _context3.
|
|
1151
|
-
case
|
|
920
|
+
return _context3.a(2);
|
|
921
|
+
case 1:
|
|
1152
922
|
urlParams = new URLSearchParams(queryString);
|
|
1153
923
|
token_url = urlParams.get(TOKEN_LS);
|
|
1154
924
|
if (!(token_url && !dauthState.isAuthenticated)) {
|
|
1155
|
-
_context3.
|
|
925
|
+
_context3.n = 4;
|
|
1156
926
|
break;
|
|
1157
927
|
}
|
|
1158
|
-
_context3.
|
|
928
|
+
_context3.n = 2;
|
|
1159
929
|
return isValidTsk(token_url);
|
|
1160
|
-
case
|
|
1161
|
-
isValid = _context3.
|
|
930
|
+
case 2:
|
|
931
|
+
isValid = _context3.v;
|
|
1162
932
|
if (!isValid) {
|
|
1163
|
-
_context3.
|
|
933
|
+
_context3.n = 3;
|
|
1164
934
|
break;
|
|
1165
935
|
}
|
|
1166
|
-
return _context3.
|
|
936
|
+
return _context3.a(2, setDauthStateAction({
|
|
1167
937
|
dispatch: dispatch,
|
|
1168
938
|
token: token_url,
|
|
1169
939
|
domainName: domainName
|
|
1170
940
|
}));
|
|
1171
|
-
case
|
|
941
|
+
case 3:
|
|
1172
942
|
setLogoutAction({
|
|
1173
943
|
dispatch: dispatch
|
|
1174
944
|
});
|
|
1175
945
|
throw new Error('Ask value in DauthProvider is not valid');
|
|
1176
|
-
case
|
|
1177
|
-
|
|
1178
|
-
return _context3.stop();
|
|
946
|
+
case 4:
|
|
947
|
+
return _context3.a(2);
|
|
1179
948
|
}
|
|
1180
949
|
}, _callee3);
|
|
1181
950
|
}))();
|
|
1182
951
|
}, []);
|
|
1183
952
|
// Auto Login
|
|
1184
953
|
useEffect(function () {
|
|
1185
|
-
_asyncToGenerator(
|
|
954
|
+
_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
1186
955
|
var token_ls, isValid;
|
|
1187
|
-
return
|
|
1188
|
-
while (1) switch (_context4.
|
|
956
|
+
return _regenerator().w(function (_context4) {
|
|
957
|
+
while (1) switch (_context4.n) {
|
|
1189
958
|
case 0:
|
|
1190
959
|
token_ls = localStorage.getItem(TOKEN_LS);
|
|
1191
960
|
if (!(token_ls && !dauthState.isAuthenticated)) {
|
|
1192
|
-
_context4.
|
|
961
|
+
_context4.n = 4;
|
|
1193
962
|
break;
|
|
1194
963
|
}
|
|
1195
|
-
_context4.
|
|
964
|
+
_context4.n = 1;
|
|
1196
965
|
return isValidTsk(token_ls);
|
|
1197
|
-
case
|
|
1198
|
-
isValid = _context4.
|
|
966
|
+
case 1:
|
|
967
|
+
isValid = _context4.v;
|
|
1199
968
|
if (!isValid) {
|
|
1200
|
-
_context4.
|
|
969
|
+
_context4.n = 2;
|
|
1201
970
|
break;
|
|
1202
971
|
}
|
|
1203
|
-
return _context4.
|
|
972
|
+
return _context4.a(2, setAutoLoginAction({
|
|
1204
973
|
dispatch: dispatch,
|
|
1205
974
|
token_ls: token_ls,
|
|
1206
975
|
domainName: domainName
|
|
1207
976
|
}));
|
|
1208
|
-
case
|
|
977
|
+
case 2:
|
|
1209
978
|
setLogoutAction({
|
|
1210
979
|
dispatch: dispatch
|
|
1211
980
|
});
|
|
1212
981
|
throw new Error('Ask value in DauthProvider is not valid');
|
|
1213
|
-
case
|
|
1214
|
-
_context4.
|
|
982
|
+
case 3:
|
|
983
|
+
_context4.n = 5;
|
|
1215
984
|
break;
|
|
1216
|
-
case
|
|
1217
|
-
return _context4.
|
|
985
|
+
case 4:
|
|
986
|
+
return _context4.a(2, dispatch({
|
|
1218
987
|
type: SET_IS_LOADING,
|
|
1219
988
|
payload: {
|
|
1220
989
|
isLoading: false
|
|
1221
990
|
}
|
|
1222
991
|
}));
|
|
1223
|
-
case
|
|
1224
|
-
|
|
1225
|
-
return _context4.stop();
|
|
992
|
+
case 5:
|
|
993
|
+
return _context4.a(2);
|
|
1226
994
|
}
|
|
1227
995
|
}, _callee4);
|
|
1228
996
|
}))();
|
|
@@ -1235,30 +1003,27 @@ var DauthProvider = function DauthProvider(props) {
|
|
|
1235
1003
|
dispatch: dispatch
|
|
1236
1004
|
});
|
|
1237
1005
|
}, []);
|
|
1238
|
-
var getAccessToken = useCallback(
|
|
1006
|
+
var getAccessToken = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
1239
1007
|
var token;
|
|
1240
|
-
return
|
|
1241
|
-
while (1) switch (_context5.
|
|
1008
|
+
return _regenerator().w(function (_context5) {
|
|
1009
|
+
while (1) switch (_context5.n) {
|
|
1242
1010
|
case 0:
|
|
1243
|
-
_context5.
|
|
1011
|
+
_context5.n = 1;
|
|
1244
1012
|
return getAccessTokenAction({
|
|
1245
1013
|
dispatch: dispatch,
|
|
1246
1014
|
domainName: domainName
|
|
1247
1015
|
});
|
|
1248
|
-
case
|
|
1249
|
-
token = _context5.
|
|
1250
|
-
return _context5.
|
|
1251
|
-
case 4:
|
|
1252
|
-
case "end":
|
|
1253
|
-
return _context5.stop();
|
|
1016
|
+
case 1:
|
|
1017
|
+
token = _context5.v;
|
|
1018
|
+
return _context5.a(2, token);
|
|
1254
1019
|
}
|
|
1255
1020
|
}, _callee5);
|
|
1256
1021
|
})), [domainName]);
|
|
1257
|
-
var updateUser = useCallback(
|
|
1258
|
-
var _ref7 = _asyncToGenerator(
|
|
1022
|
+
var updateUser = useCallback(/*#__PURE__*/function () {
|
|
1023
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(_ref6) {
|
|
1259
1024
|
var name, lastname, nickname, telPrefix, telSuffix, language, avatar, token_ls, user;
|
|
1260
|
-
return
|
|
1261
|
-
while (1) switch (_context6.
|
|
1025
|
+
return _regenerator().w(function (_context6) {
|
|
1026
|
+
while (1) switch (_context6.n) {
|
|
1262
1027
|
case 0:
|
|
1263
1028
|
name = _ref6.name, lastname = _ref6.lastname, nickname = _ref6.nickname, telPrefix = _ref6.telPrefix, telSuffix = _ref6.telSuffix, language = _ref6.language, avatar = _ref6.avatar;
|
|
1264
1029
|
token_ls = localStorage.getItem(TOKEN_LS);
|
|
@@ -1271,18 +1036,15 @@ var DauthProvider = function DauthProvider(props) {
|
|
|
1271
1036
|
language: language,
|
|
1272
1037
|
avatar: avatar
|
|
1273
1038
|
};
|
|
1274
|
-
_context6.
|
|
1039
|
+
_context6.n = 1;
|
|
1275
1040
|
return setUpdateUserAction({
|
|
1276
1041
|
dispatch: dispatch,
|
|
1277
1042
|
domainName: domainName,
|
|
1278
1043
|
user: user,
|
|
1279
1044
|
token: token_ls
|
|
1280
1045
|
});
|
|
1281
|
-
case
|
|
1282
|
-
return _context6.
|
|
1283
|
-
case 6:
|
|
1284
|
-
case "end":
|
|
1285
|
-
return _context6.stop();
|
|
1046
|
+
case 1:
|
|
1047
|
+
return _context6.a(2, _context6.v);
|
|
1286
1048
|
}
|
|
1287
1049
|
}, _callee6);
|
|
1288
1050
|
}));
|
|
@@ -1295,29 +1057,26 @@ var DauthProvider = function DauthProvider(props) {
|
|
|
1295
1057
|
if (!token_ls) return;
|
|
1296
1058
|
return window.location.replace(getClientBasePath() + "/" + domainName + "/" + routes.updateUser + "/" + token_ls);
|
|
1297
1059
|
}, [domainName]);
|
|
1298
|
-
var sendEmailVerification = useCallback(
|
|
1060
|
+
var sendEmailVerification = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
|
|
1299
1061
|
var token_ls;
|
|
1300
|
-
return
|
|
1301
|
-
while (1) switch (_context7.
|
|
1062
|
+
return _regenerator().w(function (_context7) {
|
|
1063
|
+
while (1) switch (_context7.n) {
|
|
1302
1064
|
case 0:
|
|
1303
1065
|
token_ls = localStorage.getItem(TOKEN_LS);
|
|
1304
1066
|
if (token_ls) {
|
|
1305
|
-
_context7.
|
|
1067
|
+
_context7.n = 1;
|
|
1306
1068
|
break;
|
|
1307
1069
|
}
|
|
1308
|
-
return _context7.
|
|
1309
|
-
case
|
|
1310
|
-
_context7.
|
|
1070
|
+
return _context7.a(2, false);
|
|
1071
|
+
case 1:
|
|
1072
|
+
_context7.n = 2;
|
|
1311
1073
|
return sendEmailVerificationAction({
|
|
1312
1074
|
dispatch: dispatch,
|
|
1313
1075
|
domainName: domainName,
|
|
1314
1076
|
token: token_ls
|
|
1315
1077
|
});
|
|
1316
|
-
case
|
|
1317
|
-
return _context7.
|
|
1318
|
-
case 6:
|
|
1319
|
-
case "end":
|
|
1320
|
-
return _context7.stop();
|
|
1078
|
+
case 2:
|
|
1079
|
+
return _context7.a(2, _context7.v);
|
|
1321
1080
|
}
|
|
1322
1081
|
}, _callee7);
|
|
1323
1082
|
})), [domainName]);
|