@ory/elements-react 1.0.0-next.16 → 1.0.0-next.18
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 +44 -0
- package/api-report/elements-react-client.api.json +144 -16
- package/api-report/elements-react-client.api.md +19 -8
- package/api-report/elements-react-theme.api.json +197 -0
- package/api-report/elements-react-theme.api.md +17 -2
- package/api-report/elements-react.api.json +7 -3
- package/api-report/elements-react.api.md +4 -2
- package/api-report/temp/elements-react-client.api.md +33 -0
- package/api-report/temp/elements-react-theme.api.md +149 -0
- package/api-report/temp/elements-react.api.md +423 -0
- package/dist/client/config.d.mts +21 -0
- package/dist/client/config.d.ts +21 -0
- package/dist/client/config.js +77 -0
- package/dist/client/config.js.map +1 -0
- package/dist/client/config.mjs +51 -0
- package/dist/client/config.mjs.map +1 -0
- package/dist/client/frontendClient.d.mts +3 -1
- package/dist/client/frontendClient.d.ts +3 -1
- package/dist/client/frontendClient.js +14 -2
- package/dist/client/frontendClient.js.map +1 -1
- package/dist/client/frontendClient.mjs +14 -2
- package/dist/client/frontendClient.mjs.map +1 -1
- package/dist/client/index.d.mts +3 -1
- package/dist/client/index.d.ts +3 -1
- package/dist/client/index.js +4 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +5 -0
- package/dist/client/index.mjs.map +1 -1
- package/dist/client/session-provider.d.mts +62 -0
- package/dist/client/session-provider.d.ts +62 -0
- package/dist/client/session-provider.js +96 -0
- package/dist/client/session-provider.js.map +1 -0
- package/dist/client/session-provider.mjs +71 -0
- package/dist/client/session-provider.mjs.map +1 -0
- package/dist/client/useSession.d.mts +22 -31
- package/dist/client/useSession.d.ts +22 -31
- package/dist/client/useSession.js +7 -49
- package/dist/client/useSession.js.map +1 -1
- package/dist/client/useSession.mjs +8 -49
- package/dist/client/useSession.mjs.map +1 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +148 -62
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +151 -65
- package/dist/index.mjs.map +1 -1
- package/dist/theme/default/index.css +358 -251
- package/dist/theme/default/index.css.map +1 -1
- package/dist/theme/default/index.d.mts +14 -3
- package/dist/theme/default/index.d.ts +14 -3
- package/dist/theme/default/index.js +932 -837
- package/dist/theme/default/index.js.map +1 -1
- package/dist/theme/default/index.mjs +815 -715
- package/dist/theme/default/index.mjs.map +1 -1
- package/jest.config.ts +7 -1
- package/package.json +2 -1
- package/postcss.config.ts +1 -0
- package/tailwind.config.ts +14 -13
- package/tsconfig.json +4 -3
- package/variables-processed.json +385 -187
- package/.eslintrc.js +0 -63
package/dist/index.js
CHANGED
|
@@ -115,6 +115,7 @@ function findMethodWithMessage(nodes) {
|
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
function parseStateFromFlow(flow) {
|
|
118
|
+
var _a;
|
|
118
119
|
switch (flow.flowType) {
|
|
119
120
|
case clientFetch.FlowType.Registration:
|
|
120
121
|
case clientFetch.FlowType.Login: {
|
|
@@ -125,10 +126,12 @@ function parseStateFromFlow(flow) {
|
|
|
125
126
|
return { current: "method_active", method: "code" };
|
|
126
127
|
} else if (methodWithMessage) {
|
|
127
128
|
return { current: "method_active", method: methodWithMessage.group };
|
|
128
|
-
} else if (flow.flow.active && !["default", "identifier_first"].includes(flow.flow.active)) {
|
|
129
|
+
} else if (flow.flow.active && !["default", "identifier_first", "oidc"].includes(flow.flow.active)) {
|
|
129
130
|
return { current: "method_active", method: flow.flow.active };
|
|
130
131
|
} else if (isChoosingMethod(flow.flow.ui.nodes)) {
|
|
131
132
|
return { current: "select_method" };
|
|
133
|
+
} else if ((_a = flow.flow.ui.messages) == null ? void 0 : _a.some((m) => m.id === 1010016)) {
|
|
134
|
+
return { current: "select_method" };
|
|
132
135
|
}
|
|
133
136
|
return { current: "provide_identifier" };
|
|
134
137
|
}
|
|
@@ -438,7 +441,8 @@ var en_default = {
|
|
|
438
441
|
"settings.passkey.title": "Manage Passkeys",
|
|
439
442
|
"settings.passkey.description": "Manage your passkey settings",
|
|
440
443
|
"settings.passkey.info": "Manage your passkey settings",
|
|
441
|
-
"card.footer.select-another-method": "Select another method"
|
|
444
|
+
"card.footer.select-another-method": "Select another method",
|
|
445
|
+
"account-linking.title": "Link account"
|
|
442
446
|
};
|
|
443
447
|
|
|
444
448
|
// src/locales/de.json
|
|
@@ -684,7 +688,8 @@ var de_default = {
|
|
|
684
688
|
"settings.title-totp": "Verwalten Sie die 2FA TOTP Authenticator-App",
|
|
685
689
|
"settings.title-webauthn": "Hardware-Token verwalten",
|
|
686
690
|
"settings.webauthn.info": "Hardware-Tokens werden f\xFCr die Zweitfaktor-Authentifizierung oder als Erstfaktor-Authentifizierung mit Passkeys verwendet",
|
|
687
|
-
"card.footer.select-another-method": "Eine andere Methode verwenden"
|
|
691
|
+
"card.footer.select-another-method": "Eine andere Methode verwenden",
|
|
692
|
+
"account-linking.title": "Account Verbinden"
|
|
688
693
|
};
|
|
689
694
|
|
|
690
695
|
// src/locales/es.json
|
|
@@ -930,7 +935,8 @@ var es_default = {
|
|
|
930
935
|
"settings.title-totp": "",
|
|
931
936
|
"settings.title-webauthn": "",
|
|
932
937
|
"settings.webauthn.info": "",
|
|
933
|
-
"card.footer.select-another-method": ""
|
|
938
|
+
"card.footer.select-another-method": "",
|
|
939
|
+
"account-linking.title": ""
|
|
934
940
|
};
|
|
935
941
|
|
|
936
942
|
// src/locales/fr.json
|
|
@@ -1176,7 +1182,8 @@ var fr_default = {
|
|
|
1176
1182
|
"settings.webauthn.description": "",
|
|
1177
1183
|
"settings.webauthn.info": "",
|
|
1178
1184
|
"settings.webauthn.title": "",
|
|
1179
|
-
"card.footer.select-another-method": ""
|
|
1185
|
+
"card.footer.select-another-method": "",
|
|
1186
|
+
"account-linking.title": ""
|
|
1180
1187
|
};
|
|
1181
1188
|
|
|
1182
1189
|
// src/locales/nl.json
|
|
@@ -1422,7 +1429,8 @@ var nl_default = {
|
|
|
1422
1429
|
"settings.webauthn.description": "",
|
|
1423
1430
|
"settings.webauthn.info": "",
|
|
1424
1431
|
"settings.webauthn.title": "",
|
|
1425
|
-
"card.footer.select-another-method": ""
|
|
1432
|
+
"card.footer.select-another-method": "",
|
|
1433
|
+
"account-linking.title": ""
|
|
1426
1434
|
};
|
|
1427
1435
|
|
|
1428
1436
|
// src/locales/pl.json
|
|
@@ -1668,7 +1676,8 @@ var pl_default = {
|
|
|
1668
1676
|
"settings.webauthn.description": "",
|
|
1669
1677
|
"settings.webauthn.info": "",
|
|
1670
1678
|
"settings.webauthn.title": "",
|
|
1671
|
-
"card.footer.select-another-method": ""
|
|
1679
|
+
"card.footer.select-another-method": "",
|
|
1680
|
+
"account-linking.title": ""
|
|
1672
1681
|
};
|
|
1673
1682
|
|
|
1674
1683
|
// src/locales/pt.json
|
|
@@ -1914,7 +1923,8 @@ var pt_default = {
|
|
|
1914
1923
|
"settings.webauthn.description": "",
|
|
1915
1924
|
"settings.webauthn.info": "",
|
|
1916
1925
|
"settings.webauthn.title": "",
|
|
1917
|
-
"card.footer.select-another-method": ""
|
|
1926
|
+
"card.footer.select-another-method": "",
|
|
1927
|
+
"account-linking.title": ""
|
|
1918
1928
|
};
|
|
1919
1929
|
|
|
1920
1930
|
// src/locales/sv.json
|
|
@@ -2160,7 +2170,8 @@ var sv_default = {
|
|
|
2160
2170
|
"settings.webauthn.description": "Hantera inst\xE4llningarna f\xF6r din maskinvarutoken",
|
|
2161
2171
|
"settings.webauthn.info": "H\xE5rdvarutokens anv\xE4nds f\xF6r andrafaktorsautentisering eller som f\xF6rstafaktor med l\xF6senordsnycklar",
|
|
2162
2172
|
"settings.webauthn.title": "Hantera maskinvarutokens",
|
|
2163
|
-
"card.footer.select-another-method": "V\xE4lj en annan metod"
|
|
2173
|
+
"card.footer.select-another-method": "V\xE4lj en annan metod",
|
|
2174
|
+
"account-linking.title": "L\xE4nka ditt konto"
|
|
2164
2175
|
};
|
|
2165
2176
|
|
|
2166
2177
|
// src/locales/index.ts
|
|
@@ -2248,7 +2259,8 @@ async function onSubmitLogin({ config, flow }, {
|
|
|
2248
2259
|
updateLoginFlowBody: body
|
|
2249
2260
|
}).then(() => {
|
|
2250
2261
|
var _a2;
|
|
2251
|
-
window.location.href =
|
|
2262
|
+
window.location.href = // eslint-disable-next-line promise/always-return
|
|
2263
|
+
(_a2 = flow.return_to) != null ? _a2 : config.sdk.url + "/self-service/login/browser";
|
|
2252
2264
|
}).catch(
|
|
2253
2265
|
clientFetch.handleFlowError({
|
|
2254
2266
|
onRestartFlow: () => {
|
|
@@ -2298,16 +2310,34 @@ async function onSubmitRecovery({ config, flow }, {
|
|
|
2298
2310
|
onRedirect(clientFetch.recoveryUrl(config), true);
|
|
2299
2311
|
},
|
|
2300
2312
|
onValidationError: (body2) => {
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2313
|
+
if ("error" in body2) {
|
|
2314
|
+
handleContinueWithRecoveryUIError(body2.error, config, onRedirect);
|
|
2315
|
+
return;
|
|
2316
|
+
} else {
|
|
2317
|
+
setFlowContainer({
|
|
2318
|
+
flow: body2,
|
|
2319
|
+
flowType: clientFetch.FlowType.Recovery,
|
|
2320
|
+
config
|
|
2321
|
+
});
|
|
2322
|
+
}
|
|
2306
2323
|
},
|
|
2307
2324
|
onRedirect
|
|
2308
2325
|
})
|
|
2309
2326
|
);
|
|
2310
2327
|
}
|
|
2328
|
+
function handleContinueWithRecoveryUIError(error, config, onRedirect) {
|
|
2329
|
+
if ("continue_with" in error.details && Array.isArray(error.details.continue_with)) {
|
|
2330
|
+
const continueWithRecovery = error.details.continue_with.find(clientFetch.instanceOfContinueWithRecoveryUi);
|
|
2331
|
+
if ((continueWithRecovery == null ? void 0 : continueWithRecovery.action) === "show_recovery_ui") {
|
|
2332
|
+
onRedirect(
|
|
2333
|
+
config.project.recovery_ui_url + "?flow=" + (continueWithRecovery == null ? void 0 : continueWithRecovery.flow.id),
|
|
2334
|
+
false
|
|
2335
|
+
);
|
|
2336
|
+
return;
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
onRedirect(clientFetch.recoveryUrl(config), true);
|
|
2340
|
+
}
|
|
2311
2341
|
async function onSubmitRegistration({ config, flow }, {
|
|
2312
2342
|
setFlowContainer,
|
|
2313
2343
|
body,
|
|
@@ -2438,20 +2468,25 @@ function computeDefaultValues(nodes) {
|
|
|
2438
2468
|
return nodes.reduce((acc, node) => {
|
|
2439
2469
|
const attrs = node.attributes;
|
|
2440
2470
|
if (clientFetch.isUiNodeInputAttributes(attrs)) {
|
|
2441
|
-
if (attrs.
|
|
2471
|
+
if (attrs.type === "checkbox" && typeof attrs.value === "undefined") {
|
|
2472
|
+
attrs.value = false;
|
|
2473
|
+
}
|
|
2474
|
+
if (attrs.name === "method" || attrs.type === "submit" || typeof attrs.value === "undefined") {
|
|
2442
2475
|
return acc;
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2476
|
+
}
|
|
2477
|
+
return unrollTrait(
|
|
2478
|
+
{
|
|
2479
|
+
name: attrs.name,
|
|
2480
|
+
value: attrs.value
|
|
2481
|
+
},
|
|
2482
|
+
acc
|
|
2483
|
+
);
|
|
2448
2484
|
}
|
|
2449
2485
|
return acc;
|
|
2450
2486
|
}, {});
|
|
2451
2487
|
}
|
|
2452
2488
|
function unrollTrait(input, output = {}) {
|
|
2453
2489
|
const keys = input.name.split(".");
|
|
2454
|
-
if (!keys.length) return void 0;
|
|
2455
2490
|
let current = output;
|
|
2456
2491
|
keys.forEach((key, index) => {
|
|
2457
2492
|
if (!key) return;
|
|
@@ -2488,19 +2523,19 @@ function triggerToWindowCall(trigger) {
|
|
|
2488
2523
|
}
|
|
2489
2524
|
function triggerToFunction(trigger) {
|
|
2490
2525
|
if (typeof window === "undefined") {
|
|
2491
|
-
console.
|
|
2526
|
+
console.debug(
|
|
2492
2527
|
"The Ory SDK is missing a required function: window is undefined."
|
|
2493
2528
|
);
|
|
2494
2529
|
return void 0;
|
|
2495
2530
|
}
|
|
2496
2531
|
const typedWindow = window;
|
|
2497
2532
|
if (!(trigger in typedWindow) || !typedWindow[trigger]) {
|
|
2498
|
-
console.
|
|
2533
|
+
console.debug(`The Ory SDK is missing a required function: ${trigger}.`);
|
|
2499
2534
|
return void 0;
|
|
2500
2535
|
}
|
|
2501
2536
|
const triggerFn = typedWindow[trigger];
|
|
2502
2537
|
if (typeof triggerFn !== "function") {
|
|
2503
|
-
console.
|
|
2538
|
+
console.debug(
|
|
2504
2539
|
`The Ory SDK is missing a required function: ${trigger}. It is not a function.`
|
|
2505
2540
|
);
|
|
2506
2541
|
return void 0;
|
|
@@ -2547,8 +2582,10 @@ var NodeInput = ({
|
|
|
2547
2582
|
//
|
|
2548
2583
|
...attrs
|
|
2549
2584
|
} = attributes;
|
|
2585
|
+
const isResendNode = ((_a = node.meta.label) == null ? void 0 : _a.id) === 1070008;
|
|
2586
|
+
const isScreenSelectionNode = "name" in node.attributes && node.attributes.name === "screen";
|
|
2550
2587
|
const setFormValue = () => {
|
|
2551
|
-
if (attrs.value) {
|
|
2588
|
+
if (attrs.value && !(isResendNode || isScreenSelectionNode)) {
|
|
2552
2589
|
setValue(attrs.name, attrs.value);
|
|
2553
2590
|
}
|
|
2554
2591
|
};
|
|
@@ -2573,8 +2610,6 @@ var NodeInput = ({
|
|
|
2573
2610
|
};
|
|
2574
2611
|
const isSocial = (attrs.name === "provider" || attrs.name === "link") && node.group === "oidc";
|
|
2575
2612
|
const isPinCodeInput = attrs.name === "code" && node.group === "code" || attrs.name === "totp_code" && node.group === "totp";
|
|
2576
|
-
const isResendNode = ((_a = node.meta.label) == null ? void 0 : _a.id) === 1070008;
|
|
2577
|
-
const isScreenSelectionNode = "name" in node.attributes && node.attributes.name === "screen";
|
|
2578
2613
|
switch (attributes.type) {
|
|
2579
2614
|
case clientFetch.UiNodeInputAttributesTypeEnum.Submit:
|
|
2580
2615
|
case clientFetch.UiNodeInputAttributesTypeEnum.Button:
|
|
@@ -2646,6 +2681,51 @@ function OryFormGroups({ children, groups }) {
|
|
|
2646
2681
|
return /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k);
|
|
2647
2682
|
}) });
|
|
2648
2683
|
}
|
|
2684
|
+
|
|
2685
|
+
// src/components/form/form-resolver.ts
|
|
2686
|
+
function isCodeResendRequest(data) {
|
|
2687
|
+
var _a;
|
|
2688
|
+
return (_a = data.email) != null ? _a : data.resend;
|
|
2689
|
+
}
|
|
2690
|
+
function useOryFormResolver() {
|
|
2691
|
+
const flowContainer = useOryFlow();
|
|
2692
|
+
return (data) => {
|
|
2693
|
+
if (flowContainer.formState.current === "method_active") {
|
|
2694
|
+
if (data.method === "code" && !data.code && !isCodeResendRequest(data)) {
|
|
2695
|
+
return {
|
|
2696
|
+
values: data,
|
|
2697
|
+
errors: {
|
|
2698
|
+
code: {
|
|
2699
|
+
id: 4000002,
|
|
2700
|
+
context: {
|
|
2701
|
+
property: "code"
|
|
2702
|
+
},
|
|
2703
|
+
type: "error",
|
|
2704
|
+
text: "Property code is missing"
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
};
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
return {
|
|
2711
|
+
values: data,
|
|
2712
|
+
errors: {}
|
|
2713
|
+
};
|
|
2714
|
+
};
|
|
2715
|
+
}
|
|
2716
|
+
function OryFormProvider({
|
|
2717
|
+
children,
|
|
2718
|
+
nodes
|
|
2719
|
+
}) {
|
|
2720
|
+
const flowContainer = useOryFlow();
|
|
2721
|
+
const defaultNodes = nodes ? flowContainer.flow.ui.nodes.filter((node) => node.group === clientFetch.UiNodeGroupEnum.Default).concat(nodes) : flowContainer.flow.ui.nodes;
|
|
2722
|
+
const methods = reactHookForm.useForm({
|
|
2723
|
+
// TODO: Generify this, so we have typesafety in the submit handler.
|
|
2724
|
+
defaultValues: computeDefaultValues(defaultNodes),
|
|
2725
|
+
resolver: useOryFormResolver()
|
|
2726
|
+
});
|
|
2727
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.FormProvider, { ...methods, children });
|
|
2728
|
+
}
|
|
2649
2729
|
function OryFormOidcButtons({
|
|
2650
2730
|
children,
|
|
2651
2731
|
hideDivider
|
|
@@ -2691,7 +2771,7 @@ function OryFormSocialButtonsForm() {
|
|
|
2691
2771
|
if (filteredNodes.length === 0) {
|
|
2692
2772
|
return null;
|
|
2693
2773
|
}
|
|
2694
|
-
return /* @__PURE__ */ jsxRuntime.jsx(OryForm, { children: /* @__PURE__ */ jsxRuntime.jsx(OryFormOidcButtons, {}) });
|
|
2774
|
+
return /* @__PURE__ */ jsxRuntime.jsx(OryFormProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(OryForm, { children: /* @__PURE__ */ jsxRuntime.jsx(OryFormOidcButtons, {}) }) });
|
|
2695
2775
|
}
|
|
2696
2776
|
function OryForm({ children, onAfterSubmit }) {
|
|
2697
2777
|
var _a;
|
|
@@ -2841,7 +2921,7 @@ function OryForm({ children, onAfterSubmit }) {
|
|
|
2841
2921
|
}
|
|
2842
2922
|
);
|
|
2843
2923
|
}
|
|
2844
|
-
var messageIdsToHide = [1040009, 1060003, 1080003, 1010014, 1040005];
|
|
2924
|
+
var messageIdsToHide = [1040009, 1060003, 1080003, 1010014, 1040005, 1010016];
|
|
2845
2925
|
function OryCardValidationMessages({ ...props }) {
|
|
2846
2926
|
var _a;
|
|
2847
2927
|
const { flow } = useOryFlow();
|
|
@@ -2854,18 +2934,6 @@ function OryCardValidationMessages({ ...props }) {
|
|
|
2854
2934
|
}
|
|
2855
2935
|
return /* @__PURE__ */ jsxRuntime.jsx(Message.Root, { ...props, children: messages == null ? void 0 : messages.map((message) => /* @__PURE__ */ jsxRuntime.jsx(Message.Content, { message }, message.id)) });
|
|
2856
2936
|
}
|
|
2857
|
-
function OryFormProvider({
|
|
2858
|
-
children,
|
|
2859
|
-
nodes
|
|
2860
|
-
}) {
|
|
2861
|
-
const flowContainer = useOryFlow();
|
|
2862
|
-
const defaultNodes = nodes ? flowContainer.flow.ui.nodes.filter((node) => node.group === clientFetch.UiNodeGroupEnum.Default).concat(nodes) : flowContainer.flow.ui.nodes;
|
|
2863
|
-
const methods = reactHookForm.useForm({
|
|
2864
|
-
// TODO: Generify this, so we have typesafety in the submit handler.
|
|
2865
|
-
defaultValues: computeDefaultValues(defaultNodes)
|
|
2866
|
-
});
|
|
2867
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.FormProvider, { ...methods, children });
|
|
2868
|
-
}
|
|
2869
2937
|
function OryFormSection({ children, nodes }) {
|
|
2870
2938
|
const { Card } = useComponents();
|
|
2871
2939
|
return /* @__PURE__ */ jsxRuntime.jsx(OryFormProvider, { nodes, children: /* @__PURE__ */ jsxRuntime.jsx(OryForm, { children: /* @__PURE__ */ jsxRuntime.jsx(Card.SettingsSection, { children }) }) });
|
|
@@ -3041,7 +3109,12 @@ function OrySettingsOidc({ nodes }) {
|
|
|
3041
3109
|
)
|
|
3042
3110
|
}
|
|
3043
3111
|
),
|
|
3044
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3112
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3113
|
+
Card.SettingsSectionFooter,
|
|
3114
|
+
{
|
|
3115
|
+
text: intl.formatMessage({ id: "settings.oidc.info" })
|
|
3116
|
+
}
|
|
3117
|
+
)
|
|
3045
3118
|
] });
|
|
3046
3119
|
}
|
|
3047
3120
|
var getTriggerNode = (nodes) => nodes.find(
|
|
@@ -3098,7 +3171,12 @@ function OrySettingsPasskey({ nodes }) {
|
|
|
3098
3171
|
]
|
|
3099
3172
|
}
|
|
3100
3173
|
),
|
|
3101
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3174
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3175
|
+
Card.SettingsSectionFooter,
|
|
3176
|
+
{
|
|
3177
|
+
text: intl.formatMessage({ id: "settings.passkey.info" })
|
|
3178
|
+
}
|
|
3179
|
+
)
|
|
3102
3180
|
] });
|
|
3103
3181
|
}
|
|
3104
3182
|
var getRegenerateNode = (nodes) => nodes.find(
|
|
@@ -3183,16 +3261,19 @@ function OrySettingsTotp({ nodes }) {
|
|
|
3183
3261
|
children: content
|
|
3184
3262
|
}
|
|
3185
3263
|
),
|
|
3186
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3264
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3265
|
+
Card.SettingsSectionFooter,
|
|
3266
|
+
{
|
|
3267
|
+
text: totpUnlink ? intl.formatMessage({ id: "settings.totp.info.linked" }) : intl.formatMessage({ id: "settings.totp.info.not-linked" }),
|
|
3268
|
+
children: totpLinkButton && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3269
|
+
Node2.Button,
|
|
3270
|
+
{
|
|
3271
|
+
node: totpLinkButton,
|
|
3272
|
+
attributes: totpLinkButton.attributes
|
|
3273
|
+
}
|
|
3274
|
+
)
|
|
3275
|
+
}
|
|
3276
|
+
)
|
|
3196
3277
|
] });
|
|
3197
3278
|
}
|
|
3198
3279
|
var getInputNode = (nodes) => nodes.find(
|
|
@@ -3204,9 +3285,6 @@ var getTriggerNode2 = (nodes) => nodes.find(
|
|
|
3204
3285
|
var getRemoveButtons = (nodes) => nodes.filter(
|
|
3205
3286
|
(node) => "name" in node.attributes && node.attributes.name === "webauthn_remove"
|
|
3206
3287
|
);
|
|
3207
|
-
var getScriptNode = (nodes) => nodes.find(
|
|
3208
|
-
(node) => "id" in node.attributes && node.attributes.id === "webauthn_script"
|
|
3209
|
-
);
|
|
3210
3288
|
var getRegisterNode = (nodes) => nodes.find(
|
|
3211
3289
|
(node) => "name" in node.attributes && node.attributes.name === "webauthn_register"
|
|
3212
3290
|
);
|
|
@@ -3219,7 +3297,6 @@ function OrySettingsWebauthn({ nodes }) {
|
|
|
3219
3297
|
const triggerButton = getTriggerNode2(nodes);
|
|
3220
3298
|
const inputNode = getInputNode(nodes);
|
|
3221
3299
|
const removeButtons = getRemoveButtons(nodes);
|
|
3222
|
-
const scriptNode = getScriptNode(nodes);
|
|
3223
3300
|
const registerNode = getRegisterNode(nodes);
|
|
3224
3301
|
if (!inputNode || !triggerButton) {
|
|
3225
3302
|
return null;
|
|
@@ -3242,8 +3319,6 @@ function OrySettingsWebauthn({ nodes }) {
|
|
|
3242
3319
|
}),
|
|
3243
3320
|
children: [
|
|
3244
3321
|
(_a = groups.default) == null ? void 0 : _a.map((node, i) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, `webauthn-default-${i}`)),
|
|
3245
|
-
scriptNode && /* @__PURE__ */ jsxRuntime.jsx(Node, { node: scriptNode }),
|
|
3246
|
-
registerNode && /* @__PURE__ */ jsxRuntime.jsx(Node, { node: registerNode }),
|
|
3247
3322
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3248
3323
|
Form.WebauthnSettings,
|
|
3249
3324
|
{
|
|
@@ -3255,11 +3330,17 @@ function OrySettingsWebauthn({ nodes }) {
|
|
|
3255
3330
|
},
|
|
3256
3331
|
removeButtons
|
|
3257
3332
|
}
|
|
3258
|
-
)
|
|
3333
|
+
),
|
|
3334
|
+
registerNode && /* @__PURE__ */ jsxRuntime.jsx(Node, { node: registerNode })
|
|
3259
3335
|
]
|
|
3260
3336
|
}
|
|
3261
3337
|
),
|
|
3262
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3338
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3339
|
+
Card.SettingsSectionFooter,
|
|
3340
|
+
{
|
|
3341
|
+
text: intl.formatMessage({ id: "settings.webauthn.info" })
|
|
3342
|
+
}
|
|
3343
|
+
)
|
|
3263
3344
|
] });
|
|
3264
3345
|
}
|
|
3265
3346
|
function SettingsSectionContent({ group, nodes }) {
|
|
@@ -3311,11 +3392,16 @@ function SettingsSectionContent({ group, nodes }) {
|
|
|
3311
3392
|
).map((node, k) => /* @__PURE__ */ jsxRuntime.jsx(Node, { node }, k)) })
|
|
3312
3393
|
] });
|
|
3313
3394
|
}
|
|
3395
|
+
var getScriptNode = (nodes) => nodes.find(
|
|
3396
|
+
(node) => "id" in node.attributes && node.attributes.id === "webauthn_script"
|
|
3397
|
+
);
|
|
3314
3398
|
function OrySettingsCard() {
|
|
3315
3399
|
const { flow } = useOryFlow();
|
|
3316
3400
|
const uniqueGroups = useNodesGroups(flow.ui.nodes);
|
|
3401
|
+
const scriptNode = getScriptNode(flow.ui.nodes);
|
|
3317
3402
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3318
3403
|
/* @__PURE__ */ jsxRuntime.jsx(OryCardValidationMessages, {}),
|
|
3404
|
+
scriptNode && /* @__PURE__ */ jsxRuntime.jsx(Node, { node: scriptNode }),
|
|
3319
3405
|
uniqueGroups.entries.map(([group, nodes]) => {
|
|
3320
3406
|
if (group === clientFetch.UiNodeGroupEnum.Default) {
|
|
3321
3407
|
return null;
|