@leancodepl/kratos 10.1.2 → 10.2.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/CHANGELOG.md +30 -0
- package/README.md +79 -39
- package/dist/index.js +84 -83
- package/dist/index.umd.cjs +1 -1
- package/dist/lib/factories/mkKratos.d.ts +3 -3
- package/dist/lib/factories/mkKratos.d.ts.map +1 -1
- package/dist/lib/flows/formTypes.d.ts +6 -0
- package/dist/lib/flows/formTypes.d.ts.map +1 -0
- package/dist/lib/flows/index.d.ts +6 -0
- package/dist/lib/flows/index.d.ts.map +1 -1
- package/dist/lib/flows/login/formTypes.d.ts +10 -0
- package/dist/lib/flows/login/formTypes.d.ts.map +1 -0
- package/dist/lib/flows/login/loginFlow.d.ts.map +1 -1
- package/dist/lib/flows/recovery/formTypes.d.ts +9 -0
- package/dist/lib/flows/recovery/formTypes.d.ts.map +1 -0
- package/dist/lib/flows/registration/formTypes.d.ts +9 -0
- package/dist/lib/flows/registration/formTypes.d.ts.map +1 -0
- package/dist/lib/flows/settings/formTypes.d.ts +12 -0
- package/dist/lib/flows/settings/formTypes.d.ts.map +1 -0
- package/dist/lib/flows/verification/formTypes.d.ts +7 -0
- package/dist/lib/flows/verification/formTypes.d.ts.map +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -290,7 +290,7 @@ class Qe {
|
|
|
290
290
|
})
|
|
291
291
|
};
|
|
292
292
|
let l;
|
|
293
|
-
|
|
293
|
+
Cn(c.body) || c.body instanceof URLSearchParams || Tn(c.body) ? l = c.body : this.isJsonMime(i["Content-Type"]) ? l = JSON.stringify(c.body) : l = c.body;
|
|
294
294
|
const f = {
|
|
295
295
|
...c,
|
|
296
296
|
body: l
|
|
@@ -337,10 +337,10 @@ class Qe {
|
|
|
337
337
|
return n.middleware = this.middleware.slice(), n;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function Tn(e) {
|
|
341
341
|
return typeof Blob < "u" && e instanceof Blob;
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function Cn(e) {
|
|
344
344
|
return typeof FormData < "u" && e instanceof FormData;
|
|
345
345
|
}
|
|
346
346
|
class oe extends Error {
|
|
@@ -362,9 +362,9 @@ class v extends Error {
|
|
|
362
362
|
name = "RequiredError";
|
|
363
363
|
}
|
|
364
364
|
function xt(e, t = "") {
|
|
365
|
-
return Object.keys(e).map((n) =>
|
|
365
|
+
return Object.keys(e).map((n) => Tt(n, e[n], t)).filter((n) => n.length > 0).join("&");
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function Tt(e, t, n = "") {
|
|
368
368
|
const o = n + (n.length ? `[${e}]` : e);
|
|
369
369
|
if (t instanceof Array) {
|
|
370
370
|
const i = t.map((r) => encodeURIComponent(String(r))).join(`&${encodeURIComponent(o)}=`);
|
|
@@ -372,7 +372,7 @@ function Ct(e, t, n = "") {
|
|
|
372
372
|
}
|
|
373
373
|
if (t instanceof Set) {
|
|
374
374
|
const i = Array.from(t);
|
|
375
|
-
return
|
|
375
|
+
return Tt(e, i, n);
|
|
376
376
|
}
|
|
377
377
|
return t instanceof Date ? `${encodeURIComponent(o)}=${encodeURIComponent(t.toISOString())}` : t instanceof Object ? xt(t, o) : `${encodeURIComponent(o)}=${encodeURIComponent(String(t))}`;
|
|
378
378
|
}
|
|
@@ -660,7 +660,7 @@ function so(e, t) {
|
|
|
660
660
|
userinfo_signed_response_alg: e.userinfo_signed_response_alg == null ? void 0 : e.userinfo_signed_response_alg
|
|
661
661
|
};
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function Ct(e) {
|
|
664
664
|
return co(e);
|
|
665
665
|
}
|
|
666
666
|
function co(e, t) {
|
|
@@ -799,10 +799,10 @@ const bo = {
|
|
|
799
799
|
}, xo = {
|
|
800
800
|
Input: "input"
|
|
801
801
|
};
|
|
802
|
-
function
|
|
803
|
-
return
|
|
802
|
+
function To(e) {
|
|
803
|
+
return Co(e);
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function Co(e, t) {
|
|
806
806
|
return e == null ? e : {
|
|
807
807
|
attributes: So(e.attributes),
|
|
808
808
|
group: e.group,
|
|
@@ -819,7 +819,7 @@ function Ro(e, t) {
|
|
|
819
819
|
action: e.action,
|
|
820
820
|
messages: e.messages == null ? void 0 : e.messages.map(ie),
|
|
821
821
|
method: e.method,
|
|
822
|
-
nodes: e.nodes.map(
|
|
822
|
+
nodes: e.nodes.map(To)
|
|
823
823
|
};
|
|
824
824
|
}
|
|
825
825
|
function Ae(e) {
|
|
@@ -833,7 +833,7 @@ function Oo(e, t) {
|
|
|
833
833
|
id: e.id,
|
|
834
834
|
issued_at: new Date(e.issued_at),
|
|
835
835
|
oauth2_login_challenge: e.oauth2_login_challenge == null ? void 0 : e.oauth2_login_challenge,
|
|
836
|
-
oauth2_login_request: e.oauth2_login_request == null ? void 0 :
|
|
836
|
+
oauth2_login_request: e.oauth2_login_request == null ? void 0 : Ct(e.oauth2_login_request),
|
|
837
837
|
organization_id: e.organization_id == null ? void 0 : e.organization_id,
|
|
838
838
|
refresh: e.refresh == null ? void 0 : e.refresh,
|
|
839
839
|
request_url: e.request_url,
|
|
@@ -892,7 +892,7 @@ function Jo(e, t) {
|
|
|
892
892
|
id: e.id,
|
|
893
893
|
issued_at: new Date(e.issued_at),
|
|
894
894
|
oauth2_login_challenge: e.oauth2_login_challenge == null ? void 0 : e.oauth2_login_challenge,
|
|
895
|
-
oauth2_login_request: e.oauth2_login_request == null ? void 0 :
|
|
895
|
+
oauth2_login_request: e.oauth2_login_request == null ? void 0 : Ct(e.oauth2_login_request),
|
|
896
896
|
organization_id: e.organization_id == null ? void 0 : e.organization_id,
|
|
897
897
|
request_url: e.request_url,
|
|
898
898
|
return_to: e.return_to == null ? void 0 : e.return_to,
|
|
@@ -1220,10 +1220,10 @@ function xi(e, t = !1) {
|
|
|
1220
1220
|
transient_payload: e.transient_payload
|
|
1221
1221
|
};
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1224
|
-
return
|
|
1223
|
+
function Ti(e) {
|
|
1224
|
+
return Ci(e, !1);
|
|
1225
1225
|
}
|
|
1226
|
-
function
|
|
1226
|
+
function Ci(e, t = !1) {
|
|
1227
1227
|
return e == null ? e : {
|
|
1228
1228
|
csrf_token: e.csrf_token,
|
|
1229
1229
|
method: e.method,
|
|
@@ -1283,7 +1283,7 @@ function Ji(e, t = !1) {
|
|
|
1283
1283
|
case "passkey":
|
|
1284
1284
|
return Object.assign({}, bi(e), { method: "passkey" });
|
|
1285
1285
|
case "password":
|
|
1286
|
-
return Object.assign({},
|
|
1286
|
+
return Object.assign({}, Ti(e), { method: "password" });
|
|
1287
1287
|
case "profile":
|
|
1288
1288
|
return Object.assign({}, Ri(e), { method: "profile" });
|
|
1289
1289
|
case "saml":
|
|
@@ -2464,7 +2464,7 @@ function je(e) {
|
|
|
2464
2464
|
function Nt({ attributes: e }) {
|
|
2465
2465
|
return je(e) ? e.name : e.id;
|
|
2466
2466
|
}
|
|
2467
|
-
const Et = (e) => !(typeof e != "object" || e === null || !uo(e) || e.type !== lo.Error), yr = (e) => !(typeof e != "object" || e === null || !("id" in e) || typeof e.id != "string" || "context" in e && (typeof e.context != "object" || e.context === null) || "originalError" in e && !Et(e.originalError)), pt = (e) => e?.filter(Et).map(vr) ?? [],
|
|
2467
|
+
const Et = (e) => !(typeof e != "object" || e === null || !uo(e) || e.type !== lo.Error), yr = (e) => !(typeof e != "object" || e === null || !("id" in e) || typeof e.id != "string" || "context" in e && (typeof e.context != "object" || e.context === null) || "originalError" in e && !Et(e.originalError)), pt = (e) => e?.filter(Et).map(vr) ?? [], T = ({
|
|
2468
2468
|
onSubmit: e,
|
|
2469
2469
|
onChange: t,
|
|
2470
2470
|
onBlur: n
|
|
@@ -2785,7 +2785,7 @@ const br = (e) => {
|
|
|
2785
2785
|
}
|
|
2786
2786
|
}, nt = "leancode_kratos", Z = (e) => [nt, ...e], j = (e) => `${nt}_${e}`;
|
|
2787
2787
|
function A(e) {
|
|
2788
|
-
return _(() =>
|
|
2788
|
+
return _(() => T(e.state.errorMap), [e.state.errorMap]);
|
|
2789
2789
|
}
|
|
2790
2790
|
const Dt = x(void 0);
|
|
2791
2791
|
function R() {
|
|
@@ -2794,7 +2794,7 @@ function R() {
|
|
|
2794
2794
|
throw new Error("useKratosClientContext must be used within a KratosClientContextProvider");
|
|
2795
2795
|
return e;
|
|
2796
2796
|
}
|
|
2797
|
-
function
|
|
2797
|
+
function Tr({ children: e, api: t }) {
|
|
2798
2798
|
const n = _(() => ({ kratosClient: t }), [t]);
|
|
2799
2799
|
return /* @__PURE__ */ s(Dt.Provider, { value: n, children: e });
|
|
2800
2800
|
}
|
|
@@ -2803,7 +2803,7 @@ function I({ children: e }) {
|
|
|
2803
2803
|
return /* @__PURE__ */ s(t, { type: "submit", children: e });
|
|
2804
2804
|
}
|
|
2805
2805
|
const Mt = x(void 0);
|
|
2806
|
-
function
|
|
2806
|
+
function Cr({
|
|
2807
2807
|
children: e,
|
|
2808
2808
|
emailVerificationForm: t
|
|
2809
2809
|
}) {
|
|
@@ -2923,7 +2923,7 @@ function Ir({ children: e }) {
|
|
|
2923
2923
|
return /* @__PURE__ */ s(t.Field, { name: "code", children: (o) => /* @__PURE__ */ s(
|
|
2924
2924
|
n,
|
|
2925
2925
|
{
|
|
2926
|
-
errors:
|
|
2926
|
+
errors: T(o.state.meta.errorMap),
|
|
2927
2927
|
name: o.name,
|
|
2928
2928
|
type: "text",
|
|
2929
2929
|
value: o.state.value,
|
|
@@ -2961,7 +2961,7 @@ function Mr({
|
|
|
2961
2961
|
onVerificationSuccess: n
|
|
2962
2962
|
}) {
|
|
2963
2963
|
const o = Dr({ onError: t, onVerificationSuccess: n }), i = A(o);
|
|
2964
|
-
return /* @__PURE__ */ s(
|
|
2964
|
+
return /* @__PURE__ */ s(Cr, { emailVerificationForm: o, children: /* @__PURE__ */ s(
|
|
2965
2965
|
"form",
|
|
2966
2966
|
{
|
|
2967
2967
|
onSubmit: (r) => {
|
|
@@ -3012,7 +3012,7 @@ function Ee({
|
|
|
3012
3012
|
}
|
|
3013
3013
|
);
|
|
3014
3014
|
}
|
|
3015
|
-
const
|
|
3015
|
+
const ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3016
3016
|
__proto__: null,
|
|
3017
3017
|
VerificationFlow: Lt,
|
|
3018
3018
|
VerificationFlowProvider: Ne,
|
|
@@ -3166,7 +3166,7 @@ function Pr({ children: e }) {
|
|
|
3166
3166
|
return /* @__PURE__ */ s(t.Field, { name: "identifier", children: (o) => /* @__PURE__ */ s(
|
|
3167
3167
|
n,
|
|
3168
3168
|
{
|
|
3169
|
-
errors:
|
|
3169
|
+
errors: T(o.state.meta.errorMap),
|
|
3170
3170
|
name: o.name,
|
|
3171
3171
|
type: "text",
|
|
3172
3172
|
value: o.state.value,
|
|
@@ -3180,7 +3180,7 @@ function ht({ children: e }) {
|
|
|
3180
3180
|
return /* @__PURE__ */ s(t.Field, { name: "password", children: (o) => /* @__PURE__ */ s(
|
|
3181
3181
|
n,
|
|
3182
3182
|
{
|
|
3183
|
-
errors:
|
|
3183
|
+
errors: T(o.state.meta.errorMap),
|
|
3184
3184
|
name: o.name,
|
|
3185
3185
|
type: "password",
|
|
3186
3186
|
value: o.state.value,
|
|
@@ -3271,10 +3271,10 @@ function qr({
|
|
|
3271
3271
|
if (!r) return {};
|
|
3272
3272
|
const u = et(r.ui.nodes), h = {};
|
|
3273
3273
|
return u.forEach((y) => {
|
|
3274
|
-
const
|
|
3275
|
-
if (!tt(t,
|
|
3276
|
-
const w = ze(
|
|
3277
|
-
h[w] = ({ children: F }) => /* @__PURE__ */ s(Vr, { provider:
|
|
3274
|
+
const C = y.attributes.value;
|
|
3275
|
+
if (!tt(t, C)) return;
|
|
3276
|
+
const w = ze(C);
|
|
3277
|
+
h[w] = ({ children: F }) => /* @__PURE__ */ s(Vr, { provider: C, children: F });
|
|
3278
3278
|
}), h;
|
|
3279
3279
|
}, [r, t]);
|
|
3280
3280
|
return r ? /* @__PURE__ */ s(Lr, { passwordForm: a, children: /* @__PURE__ */ s(
|
|
@@ -3348,7 +3348,7 @@ function Gr({ children: e }) {
|
|
|
3348
3348
|
return /* @__PURE__ */ s(t.Field, { name: "code", children: (o) => /* @__PURE__ */ s(
|
|
3349
3349
|
n,
|
|
3350
3350
|
{
|
|
3351
|
-
errors:
|
|
3351
|
+
errors: T(o.state.meta.errorMap),
|
|
3352
3352
|
name: o.name,
|
|
3353
3353
|
type: "text",
|
|
3354
3354
|
value: o.state.value,
|
|
@@ -3436,7 +3436,7 @@ function jr({ children: e }) {
|
|
|
3436
3436
|
return /* @__PURE__ */ s(t.Field, { name: "totp_code", children: (o) => /* @__PURE__ */ s(
|
|
3437
3437
|
n,
|
|
3438
3438
|
{
|
|
3439
|
-
errors:
|
|
3439
|
+
errors: T(o.state.meta.errorMap),
|
|
3440
3440
|
name: o.name,
|
|
3441
3441
|
type: "text",
|
|
3442
3442
|
value: o.state.value,
|
|
@@ -3510,7 +3510,7 @@ function na({
|
|
|
3510
3510
|
onFlowRestart: u,
|
|
3511
3511
|
onSessionAlreadyAvailable: h
|
|
3512
3512
|
}) {
|
|
3513
|
-
const { loginFlowId: y, setLoginFlowId:
|
|
3513
|
+
const { loginFlowId: y, setLoginFlowId: C } = Ie(), { verificationFlowId: w } = L(), { sessionManager: F } = Ge(), { isAal2Required: Q } = F.useIsAal2Required(), { mutate: te, error: H } = Ar({
|
|
3514
3514
|
returnTo: c,
|
|
3515
3515
|
aal: Q ? "aal2" : void 0
|
|
3516
3516
|
}), { data: E, error: Je } = V();
|
|
@@ -3520,7 +3520,7 @@ function na({
|
|
|
3520
3520
|
error: Je ?? void 0,
|
|
3521
3521
|
onFlowRestart: u,
|
|
3522
3522
|
createFlow: te,
|
|
3523
|
-
setFlowId:
|
|
3523
|
+
setFlowId: C,
|
|
3524
3524
|
waitForSession: !0
|
|
3525
3525
|
});
|
|
3526
3526
|
const pe = _(
|
|
@@ -3583,7 +3583,7 @@ function na({
|
|
|
3583
3583
|
function zt(e) {
|
|
3584
3584
|
return /* @__PURE__ */ s(Ne, { children: /* @__PURE__ */ s(Ur, { children: /* @__PURE__ */ s(na, { ...e }) }) });
|
|
3585
3585
|
}
|
|
3586
|
-
const
|
|
3586
|
+
const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3587
3587
|
__proto__: null,
|
|
3588
3588
|
LoginFlow: zt
|
|
3589
3589
|
}, Symbol.toStringTag, { value: "Module" })), Gt = () => {
|
|
@@ -3608,7 +3608,7 @@ const us = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3608
3608
|
}
|
|
3609
3609
|
}
|
|
3610
3610
|
};
|
|
3611
|
-
},
|
|
3611
|
+
}, ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3612
3612
|
__proto__: null,
|
|
3613
3613
|
useLogout: Gt
|
|
3614
3614
|
}, Symbol.toStringTag, { value: "Module" })), Qt = x(void 0);
|
|
@@ -3782,7 +3782,7 @@ function la({ children: e }) {
|
|
|
3782
3782
|
return /* @__PURE__ */ s(t.Field, { name: "password", children: (o) => /* @__PURE__ */ s(
|
|
3783
3783
|
n,
|
|
3784
3784
|
{
|
|
3785
|
-
errors:
|
|
3785
|
+
errors: T(o.state.meta.errorMap),
|
|
3786
3786
|
name: o.name,
|
|
3787
3787
|
type: "password",
|
|
3788
3788
|
value: o.state.value,
|
|
@@ -3832,7 +3832,7 @@ function ua({ children: e }) {
|
|
|
3832
3832
|
children: (o) => /* @__PURE__ */ s(
|
|
3833
3833
|
n,
|
|
3834
3834
|
{
|
|
3835
|
-
errors:
|
|
3835
|
+
errors: T(o.state.meta.errorMap),
|
|
3836
3836
|
name: o.name,
|
|
3837
3837
|
type: "password",
|
|
3838
3838
|
value: o.state.value,
|
|
@@ -3934,7 +3934,7 @@ function ha({ trait: e, children: t }) {
|
|
|
3934
3934
|
return /* @__PURE__ */ s(
|
|
3935
3935
|
o,
|
|
3936
3936
|
{
|
|
3937
|
-
errors:
|
|
3937
|
+
errors: T(i.state.meta.errorMap),
|
|
3938
3938
|
name: i.name,
|
|
3939
3939
|
type: "text",
|
|
3940
3940
|
value: i.state.value,
|
|
@@ -3953,7 +3953,7 @@ function _a({ trait: e, children: t }) {
|
|
|
3953
3953
|
o,
|
|
3954
3954
|
{
|
|
3955
3955
|
checked: i.state.value,
|
|
3956
|
-
errors:
|
|
3956
|
+
errors: T(i.state.meta.errorMap),
|
|
3957
3957
|
name: i.name,
|
|
3958
3958
|
type: "checkbox",
|
|
3959
3959
|
onChange: (r) => i.handleChange(r.target.checked),
|
|
@@ -4013,8 +4013,8 @@ function ga({
|
|
|
4013
4013
|
return d.forEach((h) => {
|
|
4014
4014
|
const y = h.attributes.value;
|
|
4015
4015
|
if (!tt(t, y)) return;
|
|
4016
|
-
const
|
|
4017
|
-
u[
|
|
4016
|
+
const C = ze(y);
|
|
4017
|
+
u[C] = ({ children: w }) => /* @__PURE__ */ s(wa, { provider: y, children: w });
|
|
4018
4018
|
}), u;
|
|
4019
4019
|
}, [c, t]);
|
|
4020
4020
|
return /* @__PURE__ */ s(pa, { traitsForm: r, children: /* @__PURE__ */ s(
|
|
@@ -4053,7 +4053,7 @@ function ya({
|
|
|
4053
4053
|
onFlowRestart: d,
|
|
4054
4054
|
onSessionAlreadyAvailable: u
|
|
4055
4055
|
}) {
|
|
4056
|
-
const { verificationFlowId: h } = L(), { registrationFlowId: y, setRegistrationFlowId:
|
|
4056
|
+
const { verificationFlowId: h } = L(), { registrationFlowId: y, setRegistrationFlowId: C, traitsFormCompleted: w } = G(), { error: F } = re(), { mutate: Q, error: te } = aa({
|
|
4057
4057
|
returnTo: a
|
|
4058
4058
|
});
|
|
4059
4059
|
ue({
|
|
@@ -4062,7 +4062,7 @@ function ya({
|
|
|
4062
4062
|
error: F ?? void 0,
|
|
4063
4063
|
onFlowRestart: d,
|
|
4064
4064
|
createFlow: Q,
|
|
4065
|
-
setFlowId:
|
|
4065
|
+
setFlowId: C
|
|
4066
4066
|
});
|
|
4067
4067
|
const H = _(
|
|
4068
4068
|
() => ve(F) || ve(te),
|
|
@@ -4104,10 +4104,10 @@ function ya({
|
|
|
4104
4104
|
function jt(e) {
|
|
4105
4105
|
return /* @__PURE__ */ s(Ne, { children: /* @__PURE__ */ s(ra, { children: /* @__PURE__ */ s(ya, { ...e }) }) });
|
|
4106
4106
|
}
|
|
4107
|
-
const
|
|
4107
|
+
const ps = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4108
4108
|
__proto__: null,
|
|
4109
4109
|
RegistrationFlow: jt
|
|
4110
|
-
}, Symbol.toStringTag, { value: "Module" })), Fa = j("settings_flow"),
|
|
4110
|
+
}, Symbol.toStringTag, { value: "Module" })), Fa = j("settings_flow"), Te = (e = "no_id") => Z([Fa, e]), en = x(void 0);
|
|
4111
4111
|
function at({ children: e }) {
|
|
4112
4112
|
const [t, n] = M(), [o, i] = M(!1), r = S(() => {
|
|
4113
4113
|
n(void 0);
|
|
@@ -4139,14 +4139,14 @@ function va() {
|
|
|
4139
4139
|
headers: { ...o, Accept: "application/json" }
|
|
4140
4140
|
})),
|
|
4141
4141
|
onSuccess(o) {
|
|
4142
|
-
n.setQueryDefaults(
|
|
4142
|
+
n.setQueryDefaults(Te(o.id), { staleTime: 1 / 0 }), n.setQueryData(Te(o.id), o), t(o.id);
|
|
4143
4143
|
}
|
|
4144
4144
|
});
|
|
4145
4145
|
}
|
|
4146
4146
|
function D() {
|
|
4147
4147
|
const { kratosClient: e } = R(), { settingsFlowId: t } = we();
|
|
4148
4148
|
return X({
|
|
4149
|
-
queryKey:
|
|
4149
|
+
queryKey: Te(t),
|
|
4150
4150
|
queryFn: async ({ signal: n }) => {
|
|
4151
4151
|
if (!t)
|
|
4152
4152
|
throw new Error("No settings flow ID provided", {
|
|
@@ -4195,7 +4195,7 @@ function ae() {
|
|
|
4195
4195
|
}
|
|
4196
4196
|
},
|
|
4197
4197
|
onSuccess(r) {
|
|
4198
|
-
r && "id" in r && i.setQueryData(
|
|
4198
|
+
r && "id" in r && i.setQueryData(Te(r.id), r);
|
|
4199
4199
|
}
|
|
4200
4200
|
});
|
|
4201
4201
|
}
|
|
@@ -4218,7 +4218,7 @@ function ka({ children: e }) {
|
|
|
4218
4218
|
return /* @__PURE__ */ s(t.Field, { name: "password", children: (o) => /* @__PURE__ */ s(
|
|
4219
4219
|
n,
|
|
4220
4220
|
{
|
|
4221
|
-
errors:
|
|
4221
|
+
errors: T(o.state.meta.errorMap),
|
|
4222
4222
|
name: o.name,
|
|
4223
4223
|
type: "password",
|
|
4224
4224
|
value: o.state.value,
|
|
@@ -4268,7 +4268,7 @@ function ba({ children: e }) {
|
|
|
4268
4268
|
children: (o) => /* @__PURE__ */ s(
|
|
4269
4269
|
n,
|
|
4270
4270
|
{
|
|
4271
|
-
errors:
|
|
4271
|
+
errors: T(o.state.meta.errorMap),
|
|
4272
4272
|
name: o.name,
|
|
4273
4273
|
type: "password",
|
|
4274
4274
|
value: o.state.value,
|
|
@@ -4307,7 +4307,7 @@ function xa({
|
|
|
4307
4307
|
}
|
|
4308
4308
|
});
|
|
4309
4309
|
}
|
|
4310
|
-
function
|
|
4310
|
+
function Ta({
|
|
4311
4311
|
newPasswordForm: e,
|
|
4312
4312
|
emailVerificationRequired: t,
|
|
4313
4313
|
onError: n,
|
|
@@ -4336,7 +4336,7 @@ function Ca({
|
|
|
4336
4336
|
}
|
|
4337
4337
|
) });
|
|
4338
4338
|
}
|
|
4339
|
-
function
|
|
4339
|
+
function Ca({ children: e, provider: t, type: n }) {
|
|
4340
4340
|
const { mutate: o } = ae(), { data: i } = D(), r = S(() => {
|
|
4341
4341
|
i && o({
|
|
4342
4342
|
method: "oidc",
|
|
@@ -4366,7 +4366,7 @@ function Oa({
|
|
|
4366
4366
|
const c = a.attributes.value, l = Ra(c, n.ui.nodes);
|
|
4367
4367
|
if (!l || !tt(t, c)) return;
|
|
4368
4368
|
const f = ze(c);
|
|
4369
|
-
r[f] = ({ children: d }) => /* @__PURE__ */ s(
|
|
4369
|
+
r[f] = ({ children: d }) => /* @__PURE__ */ s(Ca, { provider: c, type: l, children: d });
|
|
4370
4370
|
}), r;
|
|
4371
4371
|
}, [n, t]);
|
|
4372
4372
|
return /* @__PURE__ */ s(e, { isLoading: !n, ...o });
|
|
@@ -4445,7 +4445,7 @@ function Ma({ children: e }) {
|
|
|
4445
4445
|
return /* @__PURE__ */ s(t.Field, { name: "code", children: (o) => /* @__PURE__ */ s(
|
|
4446
4446
|
n,
|
|
4447
4447
|
{
|
|
4448
|
-
errors:
|
|
4448
|
+
errors: T(o.state.meta.errorMap),
|
|
4449
4449
|
name: o.name,
|
|
4450
4450
|
type: "text",
|
|
4451
4451
|
value: o.state.value,
|
|
@@ -4557,7 +4557,7 @@ function Va({ trait: e, children: t }) {
|
|
|
4557
4557
|
return /* @__PURE__ */ s(
|
|
4558
4558
|
o,
|
|
4559
4559
|
{
|
|
4560
|
-
errors:
|
|
4560
|
+
errors: T(i.state.meta.errorMap),
|
|
4561
4561
|
name: i.name,
|
|
4562
4562
|
type: "text",
|
|
4563
4563
|
value: i.state.value,
|
|
@@ -4576,7 +4576,7 @@ function Pa({ trait: e, children: t }) {
|
|
|
4576
4576
|
o,
|
|
4577
4577
|
{
|
|
4578
4578
|
checked: i.state.value,
|
|
4579
|
-
errors:
|
|
4579
|
+
errors: T(i.state.meta.errorMap),
|
|
4580
4580
|
name: i.name,
|
|
4581
4581
|
type: "checkbox",
|
|
4582
4582
|
onChange: (r) => i.handleChange(r.target.checked),
|
|
@@ -4669,21 +4669,21 @@ function st({
|
|
|
4669
4669
|
onChangeTraitsSuccess: u,
|
|
4670
4670
|
onFlowRestart: h
|
|
4671
4671
|
}) {
|
|
4672
|
-
const { settingsFlowId: y, setSettingsFlowId:
|
|
4672
|
+
const { settingsFlowId: y, setSettingsFlowId: C, emailVerificationRequired: w } = we(), { mutate: F } = va(), { data: Q, error: te } = D();
|
|
4673
4673
|
return ue({
|
|
4674
4674
|
initialFlowId: l,
|
|
4675
4675
|
currentFlowId: y,
|
|
4676
4676
|
error: te,
|
|
4677
4677
|
onFlowRestart: h,
|
|
4678
4678
|
createFlow: F,
|
|
4679
|
-
setFlowId:
|
|
4679
|
+
setFlowId: C
|
|
4680
4680
|
}), /* @__PURE__ */ s(
|
|
4681
4681
|
c,
|
|
4682
4682
|
{
|
|
4683
4683
|
emailVerificationRequired: w,
|
|
4684
4684
|
isLoading: !Q,
|
|
4685
4685
|
newPasswordForm: e && /* @__PURE__ */ s(
|
|
4686
|
-
|
|
4686
|
+
Ta,
|
|
4687
4687
|
{
|
|
4688
4688
|
emailVerificationRequired: w,
|
|
4689
4689
|
newPasswordForm: e,
|
|
@@ -4715,7 +4715,7 @@ function st({
|
|
|
4715
4715
|
}
|
|
4716
4716
|
);
|
|
4717
4717
|
}
|
|
4718
|
-
const
|
|
4718
|
+
const hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4719
4719
|
__proto__: null,
|
|
4720
4720
|
SettingsFlow: cn,
|
|
4721
4721
|
SettingsFlowProvider: at,
|
|
@@ -4740,7 +4740,7 @@ function Ka({ children: e }) {
|
|
|
4740
4740
|
return /* @__PURE__ */ s(t.Field, { name: "code", children: (o) => /* @__PURE__ */ s(
|
|
4741
4741
|
n,
|
|
4742
4742
|
{
|
|
4743
|
-
errors:
|
|
4743
|
+
errors: T(o.state.meta.errorMap),
|
|
4744
4744
|
name: o.name,
|
|
4745
4745
|
type: "text",
|
|
4746
4746
|
value: o.state.value,
|
|
@@ -4749,7 +4749,7 @@ function Ka({ children: e }) {
|
|
|
4749
4749
|
}
|
|
4750
4750
|
) });
|
|
4751
4751
|
}
|
|
4752
|
-
const za = j("recovery_flow"),
|
|
4752
|
+
const za = j("recovery_flow"), Ce = (e = "no_id") => Z([za, e]), un = x(void 0);
|
|
4753
4753
|
function Ga({ children: e }) {
|
|
4754
4754
|
const [t, n] = M(), o = S(() => {
|
|
4755
4755
|
n(void 0);
|
|
@@ -4779,14 +4779,14 @@ function Qa({ returnTo: e } = {}) {
|
|
|
4779
4779
|
headers: { ...i, Accept: "application/json" }
|
|
4780
4780
|
})),
|
|
4781
4781
|
onSuccess(i) {
|
|
4782
|
-
o.setQueryDefaults(
|
|
4782
|
+
o.setQueryDefaults(Ce(i.id), { staleTime: 1 / 0 }), o.setQueryData(Ce(i.id), i), n(i.id);
|
|
4783
4783
|
}
|
|
4784
4784
|
});
|
|
4785
4785
|
}
|
|
4786
4786
|
function ct() {
|
|
4787
4787
|
const { kratosClient: e } = R(), { recoveryFlowId: t } = Me();
|
|
4788
4788
|
return X({
|
|
4789
|
-
queryKey:
|
|
4789
|
+
queryKey: Ce(t),
|
|
4790
4790
|
queryFn: async ({ signal: n }) => {
|
|
4791
4791
|
if (!t)
|
|
4792
4792
|
throw new Error("No recovery flow ID provided", {
|
|
@@ -4830,7 +4830,7 @@ function dn() {
|
|
|
4830
4830
|
}
|
|
4831
4831
|
},
|
|
4832
4832
|
onSuccess(i) {
|
|
4833
|
-
i && "id" in i && o.setQueryData(
|
|
4833
|
+
i && "id" in i && o.setQueryData(Ce(i.id), i);
|
|
4834
4834
|
}
|
|
4835
4835
|
});
|
|
4836
4836
|
}
|
|
@@ -4892,7 +4892,7 @@ function ja({ children: e }) {
|
|
|
4892
4892
|
return /* @__PURE__ */ s(t.Field, { name: "email", children: (o) => /* @__PURE__ */ s(
|
|
4893
4893
|
n,
|
|
4894
4894
|
{
|
|
4895
|
-
errors:
|
|
4895
|
+
errors: T(o.state.meta.errorMap),
|
|
4896
4896
|
name: o.name,
|
|
4897
4897
|
type: "text",
|
|
4898
4898
|
value: o.state.value,
|
|
@@ -4962,11 +4962,11 @@ function ns({
|
|
|
4962
4962
|
createFlow: d,
|
|
4963
4963
|
setFlowId: f
|
|
4964
4964
|
});
|
|
4965
|
-
const
|
|
4965
|
+
const C = _(() => y ? "newPassword" : u?.state === "sent_email" ? "code" : "email", [u?.state, y]);
|
|
4966
4966
|
return /* @__PURE__ */ $e(Ke, { children: [
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4967
|
+
C === "email" && /* @__PURE__ */ s(ts, { emailForm: e, onError: r }),
|
|
4968
|
+
C === "code" && /* @__PURE__ */ s(Xa, { codeForm: t, onError: r }),
|
|
4969
|
+
C === "newPassword" && y && /* @__PURE__ */ s(
|
|
4970
4970
|
st,
|
|
4971
4971
|
{
|
|
4972
4972
|
initialFlowId: y,
|
|
@@ -4981,7 +4981,7 @@ function ns({
|
|
|
4981
4981
|
function wn(e) {
|
|
4982
4982
|
return /* @__PURE__ */ s(at, { children: /* @__PURE__ */ s(Ga, { children: /* @__PURE__ */ s(ns, { ...e }) }) });
|
|
4983
4983
|
}
|
|
4984
|
-
const
|
|
4984
|
+
const _s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4985
4985
|
__proto__: null,
|
|
4986
4986
|
RecoveryFlow: wn
|
|
4987
4987
|
}, Symbol.toStringTag, { value: "Module" })), pn = Z([j("session_manager"), "session"]), gt = (e) => ({
|
|
@@ -5069,12 +5069,13 @@ class os {
|
|
|
5069
5069
|
this.api = n, this.queryClient = t;
|
|
5070
5070
|
}
|
|
5071
5071
|
}
|
|
5072
|
-
|
|
5072
|
+
const is = {}, rs = [];
|
|
5073
|
+
function ms({
|
|
5073
5074
|
queryClient: e,
|
|
5074
5075
|
basePath: t,
|
|
5075
|
-
traits: n =
|
|
5076
|
+
traits: n = is,
|
|
5076
5077
|
SessionManager: o = os,
|
|
5077
|
-
oidcProviders: i =
|
|
5078
|
+
oidcProviders: i = rs
|
|
5078
5079
|
}) {
|
|
5079
5080
|
const r = new sr(
|
|
5080
5081
|
new bt({
|
|
@@ -5117,7 +5118,7 @@ function hs({
|
|
|
5117
5118
|
* }
|
|
5118
5119
|
* ```
|
|
5119
5120
|
*/
|
|
5120
|
-
KratosProviders: ({ children: d }) => /* @__PURE__ */ s(
|
|
5121
|
+
KratosProviders: ({ children: d }) => /* @__PURE__ */ s(Tr, { api: r, children: /* @__PURE__ */ s(hn, { sessionManager: a, children: d }) })
|
|
5121
5122
|
},
|
|
5122
5123
|
session: {
|
|
5123
5124
|
/**
|
|
@@ -5158,11 +5159,11 @@ function hs({
|
|
|
5158
5159
|
}
|
|
5159
5160
|
export {
|
|
5160
5161
|
os as BaseSessionManager,
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5162
|
+
fs as loginFlow,
|
|
5163
|
+
ws as logoutFlow,
|
|
5164
|
+
ms as mkKratos,
|
|
5165
|
+
_s as recoveryFlow,
|
|
5166
|
+
ps as registrationFlow,
|
|
5167
|
+
hs as settingsFlow,
|
|
5168
|
+
ds as verificationFlow
|
|
5168
5169
|
};
|