@leancodepl/kratos 7.3.0 → 7.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +150 -148
- package/index.esm.js +149 -149
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var client = require('@ory/client');
|
|
6
6
|
var axios = require('axios');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
7
|
var react = require('react');
|
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
9
9
|
var rxjs = require('rxjs');
|
|
10
10
|
var reactRouter = require('react-router');
|
|
11
11
|
var lodash = require('lodash');
|
|
@@ -22,6 +22,152 @@ function createKratosClient(configuration) {
|
|
|
22
22
|
}));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
26
|
+
try {
|
|
27
|
+
var info = gen[key](arg);
|
|
28
|
+
var value = info.value;
|
|
29
|
+
} catch (error) {
|
|
30
|
+
reject(error);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (info.done) {
|
|
34
|
+
resolve(value);
|
|
35
|
+
} else {
|
|
36
|
+
Promise.resolve(value).then(_next, _throw);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function _async_to_generator$2(fn) {
|
|
40
|
+
return function() {
|
|
41
|
+
var self = this, args = arguments;
|
|
42
|
+
return new Promise(function(resolve, reject) {
|
|
43
|
+
var gen = fn.apply(self, args);
|
|
44
|
+
function _next(value) {
|
|
45
|
+
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
|
|
46
|
+
}
|
|
47
|
+
function _throw(err) {
|
|
48
|
+
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
|
|
49
|
+
}
|
|
50
|
+
_next(undefined);
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function _ts_generator$2(thisArg, body) {
|
|
55
|
+
var f, y, t, g, _ = {
|
|
56
|
+
label: 0,
|
|
57
|
+
sent: function() {
|
|
58
|
+
if (t[0] & 1) throw t[1];
|
|
59
|
+
return t[1];
|
|
60
|
+
},
|
|
61
|
+
trys: [],
|
|
62
|
+
ops: []
|
|
63
|
+
};
|
|
64
|
+
return g = {
|
|
65
|
+
next: verb(0),
|
|
66
|
+
"throw": verb(1),
|
|
67
|
+
"return": verb(2)
|
|
68
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
69
|
+
return this;
|
|
70
|
+
}), g;
|
|
71
|
+
function verb(n) {
|
|
72
|
+
return function(v) {
|
|
73
|
+
return step([
|
|
74
|
+
n,
|
|
75
|
+
v
|
|
76
|
+
]);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function step(op) {
|
|
80
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
81
|
+
while(_)try {
|
|
82
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
83
|
+
if (y = 0, t) op = [
|
|
84
|
+
op[0] & 2,
|
|
85
|
+
t.value
|
|
86
|
+
];
|
|
87
|
+
switch(op[0]){
|
|
88
|
+
case 0:
|
|
89
|
+
case 1:
|
|
90
|
+
t = op;
|
|
91
|
+
break;
|
|
92
|
+
case 4:
|
|
93
|
+
_.label++;
|
|
94
|
+
return {
|
|
95
|
+
value: op[1],
|
|
96
|
+
done: false
|
|
97
|
+
};
|
|
98
|
+
case 5:
|
|
99
|
+
_.label++;
|
|
100
|
+
y = op[1];
|
|
101
|
+
op = [
|
|
102
|
+
0
|
|
103
|
+
];
|
|
104
|
+
continue;
|
|
105
|
+
case 7:
|
|
106
|
+
op = _.ops.pop();
|
|
107
|
+
_.trys.pop();
|
|
108
|
+
continue;
|
|
109
|
+
default:
|
|
110
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
111
|
+
_ = 0;
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
115
|
+
_.label = op[1];
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
119
|
+
_.label = t[1];
|
|
120
|
+
t = op;
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
if (t && _.label < t[2]) {
|
|
124
|
+
_.label = t[2];
|
|
125
|
+
_.ops.push(op);
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
if (t[2]) _.ops.pop();
|
|
129
|
+
_.trys.pop();
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
op = body.call(thisArg, _);
|
|
133
|
+
} catch (e) {
|
|
134
|
+
op = [
|
|
135
|
+
6,
|
|
136
|
+
e
|
|
137
|
+
];
|
|
138
|
+
y = 0;
|
|
139
|
+
} finally{
|
|
140
|
+
f = t = 0;
|
|
141
|
+
}
|
|
142
|
+
if (op[0] & 5) throw op[1];
|
|
143
|
+
return {
|
|
144
|
+
value: op[0] ? op[1] : void 0,
|
|
145
|
+
done: true
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
var kratosContext = /*#__PURE__*/ react.createContext({
|
|
150
|
+
components: undefined,
|
|
151
|
+
useHandleFlowError: function() {
|
|
152
|
+
return /*#__PURE__*/ _async_to_generator$2(function() {
|
|
153
|
+
return _ts_generator$2(this, function(_state) {
|
|
154
|
+
return [
|
|
155
|
+
2,
|
|
156
|
+
undefined
|
|
157
|
+
];
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
excludeScripts: false
|
|
162
|
+
});
|
|
163
|
+
function useKratosContext() {
|
|
164
|
+
var context = react.useContext(kratosContext);
|
|
165
|
+
if (context.components === undefined) {
|
|
166
|
+
throw new Error("Kratos context components were not initialized");
|
|
167
|
+
}
|
|
168
|
+
return context;
|
|
169
|
+
}
|
|
170
|
+
|
|
25
171
|
function _define_property$l(obj, key, value) {
|
|
26
172
|
if (key in obj) {
|
|
27
173
|
Object.defineProperty(obj, key, {
|
|
@@ -431,152 +577,6 @@ function DefaultMessageFormatComponent(param) {
|
|
|
431
577
|
});
|
|
432
578
|
}
|
|
433
579
|
|
|
434
|
-
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
435
|
-
try {
|
|
436
|
-
var info = gen[key](arg);
|
|
437
|
-
var value = info.value;
|
|
438
|
-
} catch (error) {
|
|
439
|
-
reject(error);
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
if (info.done) {
|
|
443
|
-
resolve(value);
|
|
444
|
-
} else {
|
|
445
|
-
Promise.resolve(value).then(_next, _throw);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
function _async_to_generator$2(fn) {
|
|
449
|
-
return function() {
|
|
450
|
-
var self = this, args = arguments;
|
|
451
|
-
return new Promise(function(resolve, reject) {
|
|
452
|
-
var gen = fn.apply(self, args);
|
|
453
|
-
function _next(value) {
|
|
454
|
-
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
|
|
455
|
-
}
|
|
456
|
-
function _throw(err) {
|
|
457
|
-
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
|
|
458
|
-
}
|
|
459
|
-
_next(undefined);
|
|
460
|
-
});
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
function _ts_generator$2(thisArg, body) {
|
|
464
|
-
var f, y, t, g, _ = {
|
|
465
|
-
label: 0,
|
|
466
|
-
sent: function() {
|
|
467
|
-
if (t[0] & 1) throw t[1];
|
|
468
|
-
return t[1];
|
|
469
|
-
},
|
|
470
|
-
trys: [],
|
|
471
|
-
ops: []
|
|
472
|
-
};
|
|
473
|
-
return g = {
|
|
474
|
-
next: verb(0),
|
|
475
|
-
"throw": verb(1),
|
|
476
|
-
"return": verb(2)
|
|
477
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
478
|
-
return this;
|
|
479
|
-
}), g;
|
|
480
|
-
function verb(n) {
|
|
481
|
-
return function(v) {
|
|
482
|
-
return step([
|
|
483
|
-
n,
|
|
484
|
-
v
|
|
485
|
-
]);
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
function step(op) {
|
|
489
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
490
|
-
while(_)try {
|
|
491
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
492
|
-
if (y = 0, t) op = [
|
|
493
|
-
op[0] & 2,
|
|
494
|
-
t.value
|
|
495
|
-
];
|
|
496
|
-
switch(op[0]){
|
|
497
|
-
case 0:
|
|
498
|
-
case 1:
|
|
499
|
-
t = op;
|
|
500
|
-
break;
|
|
501
|
-
case 4:
|
|
502
|
-
_.label++;
|
|
503
|
-
return {
|
|
504
|
-
value: op[1],
|
|
505
|
-
done: false
|
|
506
|
-
};
|
|
507
|
-
case 5:
|
|
508
|
-
_.label++;
|
|
509
|
-
y = op[1];
|
|
510
|
-
op = [
|
|
511
|
-
0
|
|
512
|
-
];
|
|
513
|
-
continue;
|
|
514
|
-
case 7:
|
|
515
|
-
op = _.ops.pop();
|
|
516
|
-
_.trys.pop();
|
|
517
|
-
continue;
|
|
518
|
-
default:
|
|
519
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
520
|
-
_ = 0;
|
|
521
|
-
continue;
|
|
522
|
-
}
|
|
523
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
524
|
-
_.label = op[1];
|
|
525
|
-
break;
|
|
526
|
-
}
|
|
527
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
528
|
-
_.label = t[1];
|
|
529
|
-
t = op;
|
|
530
|
-
break;
|
|
531
|
-
}
|
|
532
|
-
if (t && _.label < t[2]) {
|
|
533
|
-
_.label = t[2];
|
|
534
|
-
_.ops.push(op);
|
|
535
|
-
break;
|
|
536
|
-
}
|
|
537
|
-
if (t[2]) _.ops.pop();
|
|
538
|
-
_.trys.pop();
|
|
539
|
-
continue;
|
|
540
|
-
}
|
|
541
|
-
op = body.call(thisArg, _);
|
|
542
|
-
} catch (e) {
|
|
543
|
-
op = [
|
|
544
|
-
6,
|
|
545
|
-
e
|
|
546
|
-
];
|
|
547
|
-
y = 0;
|
|
548
|
-
} finally{
|
|
549
|
-
f = t = 0;
|
|
550
|
-
}
|
|
551
|
-
if (op[0] & 5) throw op[1];
|
|
552
|
-
return {
|
|
553
|
-
value: op[0] ? op[1] : void 0,
|
|
554
|
-
done: true
|
|
555
|
-
};
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
var kratosContext = /*#__PURE__*/ react.createContext({
|
|
559
|
-
components: undefined,
|
|
560
|
-
useHandleFlowError: function() {
|
|
561
|
-
return /*#__PURE__*/ _async_to_generator$2(function() {
|
|
562
|
-
return _ts_generator$2(this, function(_state) {
|
|
563
|
-
return [
|
|
564
|
-
2,
|
|
565
|
-
undefined
|
|
566
|
-
];
|
|
567
|
-
});
|
|
568
|
-
});
|
|
569
|
-
},
|
|
570
|
-
excludeScripts: false
|
|
571
|
-
});
|
|
572
|
-
function useKratosContext() {
|
|
573
|
-
var context = react.useContext(kratosContext);
|
|
574
|
-
if (context.components === undefined) {
|
|
575
|
-
throw new Error("Kratos context components were not initialized");
|
|
576
|
-
}
|
|
577
|
-
return context;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
580
|
function _define_property$g(obj, key, value) {
|
|
581
581
|
if (key in obj) {
|
|
582
582
|
Object.defineProperty(obj, key, {
|
|
@@ -862,7 +862,7 @@ function _object_spread$c(target) {
|
|
|
862
862
|
}
|
|
863
863
|
function KratosContextProvider(param) {
|
|
864
864
|
var _param_components = param.components, components = _param_components === void 0 ? {} : _param_components, useHandleFlowError = param.useHandleFlowError, excludeScripts = param.excludeScripts, children = param.children;
|
|
865
|
-
var
|
|
865
|
+
var _useContext = react.useContext(kratosContext), baseComponents = _useContext.components, baseUseHandleFlowError = _useContext.useHandleFlowError, baseExcludeScripts = _useContext.excludeScripts;
|
|
866
866
|
var value = react.useMemo(function() {
|
|
867
867
|
return {
|
|
868
868
|
components: _object_spread$c({}, baseComponents !== null && baseComponents !== void 0 ? baseComponents : defaultComponents, components),
|
|
@@ -4045,7 +4045,9 @@ exports.isUiNodeInputAttributes = isUiNodeInputAttributes;
|
|
|
4045
4045
|
exports.isUiNodeScriptAttributes = isUiNodeScriptAttributes;
|
|
4046
4046
|
exports.isUiNodeTextAttributes = isUiNodeTextAttributes;
|
|
4047
4047
|
exports.isUiNodeTextSecretsAttributes = isUiNodeTextSecretsAttributes;
|
|
4048
|
+
exports.kratosContext = kratosContext;
|
|
4048
4049
|
exports.returnToParameterName = returnToParameterName;
|
|
4050
|
+
exports.useKratosContext = useKratosContext;
|
|
4049
4051
|
exports.useLoginFlow = useLoginFlow;
|
|
4050
4052
|
exports.useLogoutFlow = useLogoutFlow;
|
|
4051
4053
|
exports.useReauthenticationFlow = useReauthenticationFlow;
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FrontendApi, Configuration, AuthenticatorAssuranceLevel } from '@ory/client';
|
|
2
2
|
import axios from 'axios';
|
|
3
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
3
|
import { createContext, useContext, useMemo, useState, useCallback, useEffect } from 'react';
|
|
4
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { ReplaySubject, map, shareReplay, Subject, switchMap, from, catchError, of } from 'rxjs';
|
|
6
6
|
import { useLocation, useNavigate } from 'react-router';
|
|
7
7
|
import { omit, isObject, isString } from 'lodash';
|
|
@@ -13,6 +13,152 @@ function createKratosClient(configuration) {
|
|
|
13
13
|
}));
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
17
|
+
try {
|
|
18
|
+
var info = gen[key](arg);
|
|
19
|
+
var value = info.value;
|
|
20
|
+
} catch (error) {
|
|
21
|
+
reject(error);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (info.done) {
|
|
25
|
+
resolve(value);
|
|
26
|
+
} else {
|
|
27
|
+
Promise.resolve(value).then(_next, _throw);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function _async_to_generator$2(fn) {
|
|
31
|
+
return function() {
|
|
32
|
+
var self = this, args = arguments;
|
|
33
|
+
return new Promise(function(resolve, reject) {
|
|
34
|
+
var gen = fn.apply(self, args);
|
|
35
|
+
function _next(value) {
|
|
36
|
+
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
|
|
37
|
+
}
|
|
38
|
+
function _throw(err) {
|
|
39
|
+
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
|
|
40
|
+
}
|
|
41
|
+
_next(undefined);
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function _ts_generator$2(thisArg, body) {
|
|
46
|
+
var f, y, t, g, _ = {
|
|
47
|
+
label: 0,
|
|
48
|
+
sent: function() {
|
|
49
|
+
if (t[0] & 1) throw t[1];
|
|
50
|
+
return t[1];
|
|
51
|
+
},
|
|
52
|
+
trys: [],
|
|
53
|
+
ops: []
|
|
54
|
+
};
|
|
55
|
+
return g = {
|
|
56
|
+
next: verb(0),
|
|
57
|
+
"throw": verb(1),
|
|
58
|
+
"return": verb(2)
|
|
59
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
60
|
+
return this;
|
|
61
|
+
}), g;
|
|
62
|
+
function verb(n) {
|
|
63
|
+
return function(v) {
|
|
64
|
+
return step([
|
|
65
|
+
n,
|
|
66
|
+
v
|
|
67
|
+
]);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function step(op) {
|
|
71
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
72
|
+
while(_)try {
|
|
73
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
74
|
+
if (y = 0, t) op = [
|
|
75
|
+
op[0] & 2,
|
|
76
|
+
t.value
|
|
77
|
+
];
|
|
78
|
+
switch(op[0]){
|
|
79
|
+
case 0:
|
|
80
|
+
case 1:
|
|
81
|
+
t = op;
|
|
82
|
+
break;
|
|
83
|
+
case 4:
|
|
84
|
+
_.label++;
|
|
85
|
+
return {
|
|
86
|
+
value: op[1],
|
|
87
|
+
done: false
|
|
88
|
+
};
|
|
89
|
+
case 5:
|
|
90
|
+
_.label++;
|
|
91
|
+
y = op[1];
|
|
92
|
+
op = [
|
|
93
|
+
0
|
|
94
|
+
];
|
|
95
|
+
continue;
|
|
96
|
+
case 7:
|
|
97
|
+
op = _.ops.pop();
|
|
98
|
+
_.trys.pop();
|
|
99
|
+
continue;
|
|
100
|
+
default:
|
|
101
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
102
|
+
_ = 0;
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
106
|
+
_.label = op[1];
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
110
|
+
_.label = t[1];
|
|
111
|
+
t = op;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
if (t && _.label < t[2]) {
|
|
115
|
+
_.label = t[2];
|
|
116
|
+
_.ops.push(op);
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
if (t[2]) _.ops.pop();
|
|
120
|
+
_.trys.pop();
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
op = body.call(thisArg, _);
|
|
124
|
+
} catch (e) {
|
|
125
|
+
op = [
|
|
126
|
+
6,
|
|
127
|
+
e
|
|
128
|
+
];
|
|
129
|
+
y = 0;
|
|
130
|
+
} finally{
|
|
131
|
+
f = t = 0;
|
|
132
|
+
}
|
|
133
|
+
if (op[0] & 5) throw op[1];
|
|
134
|
+
return {
|
|
135
|
+
value: op[0] ? op[1] : void 0,
|
|
136
|
+
done: true
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
var kratosContext = /*#__PURE__*/ createContext({
|
|
141
|
+
components: undefined,
|
|
142
|
+
useHandleFlowError: function() {
|
|
143
|
+
return /*#__PURE__*/ _async_to_generator$2(function() {
|
|
144
|
+
return _ts_generator$2(this, function(_state) {
|
|
145
|
+
return [
|
|
146
|
+
2,
|
|
147
|
+
undefined
|
|
148
|
+
];
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
excludeScripts: false
|
|
153
|
+
});
|
|
154
|
+
function useKratosContext() {
|
|
155
|
+
var context = useContext(kratosContext);
|
|
156
|
+
if (context.components === undefined) {
|
|
157
|
+
throw new Error("Kratos context components were not initialized");
|
|
158
|
+
}
|
|
159
|
+
return context;
|
|
160
|
+
}
|
|
161
|
+
|
|
16
162
|
function _define_property$l(obj, key, value) {
|
|
17
163
|
if (key in obj) {
|
|
18
164
|
Object.defineProperty(obj, key, {
|
|
@@ -422,152 +568,6 @@ function DefaultMessageFormatComponent(param) {
|
|
|
422
568
|
});
|
|
423
569
|
}
|
|
424
570
|
|
|
425
|
-
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
426
|
-
try {
|
|
427
|
-
var info = gen[key](arg);
|
|
428
|
-
var value = info.value;
|
|
429
|
-
} catch (error) {
|
|
430
|
-
reject(error);
|
|
431
|
-
return;
|
|
432
|
-
}
|
|
433
|
-
if (info.done) {
|
|
434
|
-
resolve(value);
|
|
435
|
-
} else {
|
|
436
|
-
Promise.resolve(value).then(_next, _throw);
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
function _async_to_generator$2(fn) {
|
|
440
|
-
return function() {
|
|
441
|
-
var self = this, args = arguments;
|
|
442
|
-
return new Promise(function(resolve, reject) {
|
|
443
|
-
var gen = fn.apply(self, args);
|
|
444
|
-
function _next(value) {
|
|
445
|
-
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
|
|
446
|
-
}
|
|
447
|
-
function _throw(err) {
|
|
448
|
-
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
|
|
449
|
-
}
|
|
450
|
-
_next(undefined);
|
|
451
|
-
});
|
|
452
|
-
};
|
|
453
|
-
}
|
|
454
|
-
function _ts_generator$2(thisArg, body) {
|
|
455
|
-
var f, y, t, g, _ = {
|
|
456
|
-
label: 0,
|
|
457
|
-
sent: function() {
|
|
458
|
-
if (t[0] & 1) throw t[1];
|
|
459
|
-
return t[1];
|
|
460
|
-
},
|
|
461
|
-
trys: [],
|
|
462
|
-
ops: []
|
|
463
|
-
};
|
|
464
|
-
return g = {
|
|
465
|
-
next: verb(0),
|
|
466
|
-
"throw": verb(1),
|
|
467
|
-
"return": verb(2)
|
|
468
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
469
|
-
return this;
|
|
470
|
-
}), g;
|
|
471
|
-
function verb(n) {
|
|
472
|
-
return function(v) {
|
|
473
|
-
return step([
|
|
474
|
-
n,
|
|
475
|
-
v
|
|
476
|
-
]);
|
|
477
|
-
};
|
|
478
|
-
}
|
|
479
|
-
function step(op) {
|
|
480
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
481
|
-
while(_)try {
|
|
482
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
483
|
-
if (y = 0, t) op = [
|
|
484
|
-
op[0] & 2,
|
|
485
|
-
t.value
|
|
486
|
-
];
|
|
487
|
-
switch(op[0]){
|
|
488
|
-
case 0:
|
|
489
|
-
case 1:
|
|
490
|
-
t = op;
|
|
491
|
-
break;
|
|
492
|
-
case 4:
|
|
493
|
-
_.label++;
|
|
494
|
-
return {
|
|
495
|
-
value: op[1],
|
|
496
|
-
done: false
|
|
497
|
-
};
|
|
498
|
-
case 5:
|
|
499
|
-
_.label++;
|
|
500
|
-
y = op[1];
|
|
501
|
-
op = [
|
|
502
|
-
0
|
|
503
|
-
];
|
|
504
|
-
continue;
|
|
505
|
-
case 7:
|
|
506
|
-
op = _.ops.pop();
|
|
507
|
-
_.trys.pop();
|
|
508
|
-
continue;
|
|
509
|
-
default:
|
|
510
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
511
|
-
_ = 0;
|
|
512
|
-
continue;
|
|
513
|
-
}
|
|
514
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
515
|
-
_.label = op[1];
|
|
516
|
-
break;
|
|
517
|
-
}
|
|
518
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
519
|
-
_.label = t[1];
|
|
520
|
-
t = op;
|
|
521
|
-
break;
|
|
522
|
-
}
|
|
523
|
-
if (t && _.label < t[2]) {
|
|
524
|
-
_.label = t[2];
|
|
525
|
-
_.ops.push(op);
|
|
526
|
-
break;
|
|
527
|
-
}
|
|
528
|
-
if (t[2]) _.ops.pop();
|
|
529
|
-
_.trys.pop();
|
|
530
|
-
continue;
|
|
531
|
-
}
|
|
532
|
-
op = body.call(thisArg, _);
|
|
533
|
-
} catch (e) {
|
|
534
|
-
op = [
|
|
535
|
-
6,
|
|
536
|
-
e
|
|
537
|
-
];
|
|
538
|
-
y = 0;
|
|
539
|
-
} finally{
|
|
540
|
-
f = t = 0;
|
|
541
|
-
}
|
|
542
|
-
if (op[0] & 5) throw op[1];
|
|
543
|
-
return {
|
|
544
|
-
value: op[0] ? op[1] : void 0,
|
|
545
|
-
done: true
|
|
546
|
-
};
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
var kratosContext = /*#__PURE__*/ createContext({
|
|
550
|
-
components: undefined,
|
|
551
|
-
useHandleFlowError: function() {
|
|
552
|
-
return /*#__PURE__*/ _async_to_generator$2(function() {
|
|
553
|
-
return _ts_generator$2(this, function(_state) {
|
|
554
|
-
return [
|
|
555
|
-
2,
|
|
556
|
-
undefined
|
|
557
|
-
];
|
|
558
|
-
});
|
|
559
|
-
});
|
|
560
|
-
},
|
|
561
|
-
excludeScripts: false
|
|
562
|
-
});
|
|
563
|
-
function useKratosContext() {
|
|
564
|
-
var context = useContext(kratosContext);
|
|
565
|
-
if (context.components === undefined) {
|
|
566
|
-
throw new Error("Kratos context components were not initialized");
|
|
567
|
-
}
|
|
568
|
-
return context;
|
|
569
|
-
}
|
|
570
|
-
|
|
571
571
|
function _define_property$g(obj, key, value) {
|
|
572
572
|
if (key in obj) {
|
|
573
573
|
Object.defineProperty(obj, key, {
|
|
@@ -853,7 +853,7 @@ function _object_spread$c(target) {
|
|
|
853
853
|
}
|
|
854
854
|
function KratosContextProvider(param) {
|
|
855
855
|
var _param_components = param.components, components = _param_components === void 0 ? {} : _param_components, useHandleFlowError = param.useHandleFlowError, excludeScripts = param.excludeScripts, children = param.children;
|
|
856
|
-
var
|
|
856
|
+
var _useContext = useContext(kratosContext), baseComponents = _useContext.components, baseUseHandleFlowError = _useContext.useHandleFlowError, baseExcludeScripts = _useContext.excludeScripts;
|
|
857
857
|
var value = useMemo(function() {
|
|
858
858
|
return {
|
|
859
859
|
components: _object_spread$c({}, baseComponents !== null && baseComponents !== void 0 ? baseComponents : defaultComponents, components),
|
|
@@ -4020,4 +4020,4 @@ function UserSettingsCard(param) {
|
|
|
4020
4020
|
});
|
|
4021
4021
|
}
|
|
4022
4022
|
|
|
4023
|
-
export { BaseSessionManager, ErrorId, ErrorSystem, ErrorValidation, ErrorValidationLogin, ErrorValidationRecovery, ErrorValidationRegistration, ErrorValidationSettings, ErrorValidationVerification, InfoNodeLabel, InfoSelfServiceLogin, InfoSelfServiceLogout, InfoSelfServiceMFA, InfoSelfServiceRecovery, InfoSelfServiceRegistration, InfoSelfServiceSettings, InfoSelfServiceVerification, KratosContextProvider, LoginCard, RecoveryCard, RegistrationCard, UserSettingsCard, VerificationCard, aalParameterName, createKratosClient, flowIdParameterName, isUiNodeAnchorAttributes, isUiNodeImageAttributes, isUiNodeInputAttributes, isUiNodeScriptAttributes, isUiNodeTextAttributes, isUiNodeTextSecretsAttributes, returnToParameterName, useLoginFlow, useLogoutFlow, useReauthenticationFlow, useRecoveryFlow, useRegisterFlow, useSettingsFlow, useVerificationFlow };
|
|
4023
|
+
export { BaseSessionManager, ErrorId, ErrorSystem, ErrorValidation, ErrorValidationLogin, ErrorValidationRecovery, ErrorValidationRegistration, ErrorValidationSettings, ErrorValidationVerification, InfoNodeLabel, InfoSelfServiceLogin, InfoSelfServiceLogout, InfoSelfServiceMFA, InfoSelfServiceRecovery, InfoSelfServiceRegistration, InfoSelfServiceSettings, InfoSelfServiceVerification, KratosContextProvider, LoginCard, RecoveryCard, RegistrationCard, UserSettingsCard, VerificationCard, aalParameterName, createKratosClient, flowIdParameterName, isUiNodeAnchorAttributes, isUiNodeImageAttributes, isUiNodeInputAttributes, isUiNodeScriptAttributes, isUiNodeTextAttributes, isUiNodeTextSecretsAttributes, kratosContext, returnToParameterName, useKratosContext, useLoginFlow, useLogoutFlow, useReauthenticationFlow, useRecoveryFlow, useRegisterFlow, useSettingsFlow, useVerificationFlow };
|
package/package.json
CHANGED