@leancodepl/kratos 7.7.0 → 7.8.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/index.cjs.js +229 -98
- package/index.esm.js +230 -99
- package/package.json +3 -3
- package/src/lib/cards/userSettingsCard.d.ts +2 -2
- package/src/lib/defaultComponents/DefaultLinkComponent/index.d.ts +1 -1
- package/src/lib/sections/identifierFirstLoginSection.d.ts +8 -0
- package/src/lib/sections/passkeySettingsSection.d.ts +8 -0
- package/src/lib/sections/profileLoginSection.d.ts +8 -0
- package/src/lib/sections/profileRegistrationSection.d.ts +8 -0
- package/src/lib/types/components.d.ts +3 -0
- package/src/lib/utils/helpers.d.ts +4 -1
- package/src/lib/sections/webAuthnSettingsSection.d.ts +0 -8
package/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FrontendApi, Configuration, AuthenticatorAssuranceLevel } from '@ory/client';
|
|
1
|
+
import { FrontendApi, Configuration, AuthenticatorAssuranceLevel, UiNodeGroupEnum } from '@ory/client';
|
|
2
2
|
import axios from 'axios';
|
|
3
3
|
import { createContext, useContext, useMemo, useState, useCallback, useEffect } from 'react';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -820,7 +820,10 @@ var defaultComponents = {
|
|
|
820
820
|
WebAuthnSettingsSectionWrapper: "div",
|
|
821
821
|
LookupSecretSettingsSectionWrapper: "div",
|
|
822
822
|
OidcSettingsSectionWrapper: "div",
|
|
823
|
-
TotpSettingsSectionWrapper: "div"
|
|
823
|
+
TotpSettingsSectionWrapper: "div",
|
|
824
|
+
IdentifierFirstLoginSectionWrapper: "div",
|
|
825
|
+
ProfileLoginSectionWrapper: "div",
|
|
826
|
+
ProfileRegistrationSectionWrapper: "div"
|
|
824
827
|
};
|
|
825
828
|
|
|
826
829
|
function _define_property$d(obj, key, value) {
|
|
@@ -2514,17 +2517,17 @@ function getNodeInputType(attr) {
|
|
|
2514
2517
|
if (!groups && !attributes && !excludeAttributes) return true;
|
|
2515
2518
|
var g = search(groups);
|
|
2516
2519
|
if (!withoutDefaultGroup) {
|
|
2517
|
-
g.push(
|
|
2520
|
+
g.push(UiNodeGroupEnum.Default);
|
|
2518
2521
|
}
|
|
2519
2522
|
// filter the attributes
|
|
2520
2523
|
var a = search(attributes);
|
|
2521
2524
|
if (!withoutDefaultAttributes) {
|
|
2522
2525
|
// always add hidden fields e.g. csrf
|
|
2523
|
-
if (group.includes(
|
|
2526
|
+
if (group.includes(UiNodeGroupEnum.Default)) {
|
|
2524
2527
|
a.push("hidden");
|
|
2525
2528
|
}
|
|
2526
2529
|
// automatically add the necessary fields for webauthn and totp
|
|
2527
|
-
if (group.includes(
|
|
2530
|
+
if (group.includes(UiNodeGroupEnum.Webauthn) || group.includes(UiNodeGroupEnum.Totp)) {
|
|
2528
2531
|
a.push("input", "script");
|
|
2529
2532
|
}
|
|
2530
2533
|
}
|
|
@@ -2617,7 +2620,7 @@ function Node(param) {
|
|
|
2617
2620
|
case "submit":
|
|
2618
2621
|
{
|
|
2619
2622
|
var _node_meta_label;
|
|
2620
|
-
var isSocial = (attrs.name === "provider" || attrs.name === "link") && node.group ===
|
|
2623
|
+
var isSocial = (attrs.name === "provider" || attrs.name === "link") && node.group === UiNodeGroupEnum.Oidc;
|
|
2621
2624
|
var submit = {
|
|
2622
2625
|
type: attrs.type,
|
|
2623
2626
|
name: attrs.name
|
|
@@ -2831,7 +2834,7 @@ function useScriptNodes(param) {
|
|
|
2831
2834
|
}
|
|
2832
2835
|
var scriptNodes = filterNodesByGroups({
|
|
2833
2836
|
nodes: nodes,
|
|
2834
|
-
groups:
|
|
2837
|
+
groups: UiNodeGroupEnum.Webauthn,
|
|
2835
2838
|
attributes: "text/javascript",
|
|
2836
2839
|
withoutDefaultGroup: true,
|
|
2837
2840
|
withoutDefaultAttributes: true
|
|
@@ -2991,7 +2994,7 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
2991
2994
|
includeCSRF: true,
|
|
2992
2995
|
filter: formFilterOverride !== null && formFilterOverride !== void 0 ? formFilterOverride : {
|
|
2993
2996
|
nodes: flow.ui.nodes,
|
|
2994
|
-
groups:
|
|
2997
|
+
groups: UiNodeGroupEnum.Default,
|
|
2995
2998
|
attributes: "hidden"
|
|
2996
2999
|
}
|
|
2997
3000
|
}),
|
|
@@ -3003,37 +3006,55 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
3003
3006
|
function hasOidc(nodes) {
|
|
3004
3007
|
return nodes.some(function(param) {
|
|
3005
3008
|
var group = param.group;
|
|
3006
|
-
return group ===
|
|
3009
|
+
return group === UiNodeGroupEnum.Oidc;
|
|
3007
3010
|
});
|
|
3008
3011
|
}
|
|
3009
3012
|
function hasPassword(nodes) {
|
|
3010
3013
|
return nodes.some(function(param) {
|
|
3011
3014
|
var group = param.group;
|
|
3012
|
-
return group ===
|
|
3015
|
+
return group === UiNodeGroupEnum.Password;
|
|
3013
3016
|
});
|
|
3014
3017
|
}
|
|
3015
|
-
function
|
|
3018
|
+
function hasDefault(nodes) {
|
|
3016
3019
|
return nodes.some(function(param) {
|
|
3017
3020
|
var group = param.group;
|
|
3018
|
-
return group ===
|
|
3021
|
+
return group === UiNodeGroupEnum.Default;
|
|
3022
|
+
});
|
|
3023
|
+
}
|
|
3024
|
+
function hasProfile(nodes) {
|
|
3025
|
+
return nodes.some(function(param) {
|
|
3026
|
+
var group = param.group;
|
|
3027
|
+
return group === UiNodeGroupEnum.Profile;
|
|
3028
|
+
});
|
|
3029
|
+
}
|
|
3030
|
+
function hasPasskey(nodes) {
|
|
3031
|
+
return nodes.some(function(param) {
|
|
3032
|
+
var group = param.group;
|
|
3033
|
+
return group === UiNodeGroupEnum.Passkey;
|
|
3034
|
+
});
|
|
3035
|
+
}
|
|
3036
|
+
function hasIdentifierFirst(nodes) {
|
|
3037
|
+
return nodes.some(function(param) {
|
|
3038
|
+
var group = param.group;
|
|
3039
|
+
return group === UiNodeGroupEnum.IdentifierFirst;
|
|
3019
3040
|
});
|
|
3020
3041
|
}
|
|
3021
3042
|
function hasLookupSecret(nodes) {
|
|
3022
3043
|
return nodes.some(function(param) {
|
|
3023
3044
|
var group = param.group;
|
|
3024
|
-
return group ===
|
|
3045
|
+
return group === UiNodeGroupEnum.LookupSecret;
|
|
3025
3046
|
});
|
|
3026
3047
|
}
|
|
3027
3048
|
function hasTotp(nodes) {
|
|
3028
3049
|
return nodes.some(function(param) {
|
|
3029
3050
|
var group = param.group;
|
|
3030
|
-
return group ===
|
|
3051
|
+
return group === UiNodeGroupEnum.Totp;
|
|
3031
3052
|
});
|
|
3032
3053
|
}
|
|
3033
3054
|
function hasCode(nodes) {
|
|
3034
3055
|
return nodes.some(function(param) {
|
|
3035
3056
|
var group = param.group;
|
|
3036
|
-
return group ===
|
|
3057
|
+
return group === UiNodeGroupEnum.Code;
|
|
3037
3058
|
});
|
|
3038
3059
|
}
|
|
3039
3060
|
|
|
@@ -3050,9 +3071,7 @@ function hasCode(nodes) {
|
|
|
3050
3071
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3051
3072
|
filter: {
|
|
3052
3073
|
nodes: nodes,
|
|
3053
|
-
groups:
|
|
3054
|
-
"code"
|
|
3055
|
-
],
|
|
3074
|
+
groups: UiNodeGroupEnum.Code,
|
|
3056
3075
|
// we don't want to map the default group twice
|
|
3057
3076
|
// the form already maps hidden fields under the default group
|
|
3058
3077
|
// we are only interested in hidden fields that are under the code group
|
|
@@ -3066,7 +3085,7 @@ function hasCode(nodes) {
|
|
|
3066
3085
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3067
3086
|
filter: {
|
|
3068
3087
|
nodes: nodes,
|
|
3069
|
-
groups:
|
|
3088
|
+
groups: UiNodeGroupEnum.Code,
|
|
3070
3089
|
withoutDefaultAttributes: true,
|
|
3071
3090
|
excludeAttributes: [
|
|
3072
3091
|
"hidden",
|
|
@@ -3078,7 +3097,7 @@ function hasCode(nodes) {
|
|
|
3078
3097
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3079
3098
|
filter: {
|
|
3080
3099
|
nodes: nodes,
|
|
3081
|
-
groups:
|
|
3100
|
+
groups: UiNodeGroupEnum.Code,
|
|
3082
3101
|
withoutDefaultAttributes: true,
|
|
3083
3102
|
attributes: [
|
|
3084
3103
|
"button",
|
|
@@ -3090,6 +3109,34 @@ function hasCode(nodes) {
|
|
|
3090
3109
|
});
|
|
3091
3110
|
}
|
|
3092
3111
|
|
|
3112
|
+
function IdentifierFirstLoginSection(param) {
|
|
3113
|
+
var nodes = param.nodes, IdentifierFirstLoginSectionWrapper = param.IdentifierFirstLoginSectionWrapper;
|
|
3114
|
+
return /*#__PURE__*/ jsxs(IdentifierFirstLoginSectionWrapper, {
|
|
3115
|
+
children: [
|
|
3116
|
+
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3117
|
+
filter: {
|
|
3118
|
+
nodes: nodes,
|
|
3119
|
+
groups: [
|
|
3120
|
+
UiNodeGroupEnum.Default,
|
|
3121
|
+
UiNodeGroupEnum.IdentifierFirst
|
|
3122
|
+
],
|
|
3123
|
+
excludeAttributes: [
|
|
3124
|
+
"submit",
|
|
3125
|
+
"hidden"
|
|
3126
|
+
]
|
|
3127
|
+
}
|
|
3128
|
+
}),
|
|
3129
|
+
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3130
|
+
filter: {
|
|
3131
|
+
nodes: nodes,
|
|
3132
|
+
groups: UiNodeGroupEnum.IdentifierFirst,
|
|
3133
|
+
attributes: "submit"
|
|
3134
|
+
}
|
|
3135
|
+
})
|
|
3136
|
+
]
|
|
3137
|
+
});
|
|
3138
|
+
}
|
|
3139
|
+
|
|
3093
3140
|
/**
|
|
3094
3141
|
* LinkSection renders the fields for recovery and verification
|
|
3095
3142
|
* Please see the Ory docs for more information:
|
|
@@ -3103,8 +3150,8 @@ function hasCode(nodes) {
|
|
|
3103
3150
|
filter: {
|
|
3104
3151
|
nodes: nodes,
|
|
3105
3152
|
groups: [
|
|
3106
|
-
|
|
3107
|
-
|
|
3153
|
+
UiNodeGroupEnum.Link,
|
|
3154
|
+
UiNodeGroupEnum.Code
|
|
3108
3155
|
],
|
|
3109
3156
|
excludeAttributes: "submit"
|
|
3110
3157
|
}
|
|
@@ -3113,8 +3160,8 @@ function hasCode(nodes) {
|
|
|
3113
3160
|
filter: {
|
|
3114
3161
|
nodes: nodes,
|
|
3115
3162
|
groups: [
|
|
3116
|
-
|
|
3117
|
-
|
|
3163
|
+
UiNodeGroupEnum.Link,
|
|
3164
|
+
UiNodeGroupEnum.Code
|
|
3118
3165
|
],
|
|
3119
3166
|
attributes: "submit"
|
|
3120
3167
|
}
|
|
@@ -3132,8 +3179,8 @@ function LoginSection(param) {
|
|
|
3132
3179
|
filter: {
|
|
3133
3180
|
nodes: nodes,
|
|
3134
3181
|
groups: [
|
|
3135
|
-
|
|
3136
|
-
|
|
3182
|
+
UiNodeGroupEnum.Default,
|
|
3183
|
+
UiNodeGroupEnum.Password
|
|
3137
3184
|
],
|
|
3138
3185
|
excludeAttributes: [
|
|
3139
3186
|
"submit",
|
|
@@ -3144,9 +3191,7 @@ function LoginSection(param) {
|
|
|
3144
3191
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3145
3192
|
filter: {
|
|
3146
3193
|
nodes: nodes,
|
|
3147
|
-
groups:
|
|
3148
|
-
"password"
|
|
3149
|
-
],
|
|
3194
|
+
groups: UiNodeGroupEnum.Password,
|
|
3150
3195
|
attributes: "submit"
|
|
3151
3196
|
}
|
|
3152
3197
|
})
|
|
@@ -3159,7 +3204,7 @@ function OidcSection(param) {
|
|
|
3159
3204
|
if (!hasOidc(flow.ui.nodes)) return null;
|
|
3160
3205
|
var hasOidcTraits = filterNodesByGroups({
|
|
3161
3206
|
nodes: flow.ui.nodes,
|
|
3162
|
-
groups:
|
|
3207
|
+
groups: UiNodeGroupEnum.Oidc,
|
|
3163
3208
|
withoutDefaultGroup: true,
|
|
3164
3209
|
excludeAttributes: "submit"
|
|
3165
3210
|
}).length > 0;
|
|
@@ -3168,7 +3213,7 @@ function OidcSection(param) {
|
|
|
3168
3213
|
hasOidcTraits && /*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3169
3214
|
filter: {
|
|
3170
3215
|
nodes: flow.ui.nodes,
|
|
3171
|
-
groups:
|
|
3216
|
+
groups: UiNodeGroupEnum.Oidc,
|
|
3172
3217
|
withoutDefaultGroup: true,
|
|
3173
3218
|
excludeAttributes: "submit"
|
|
3174
3219
|
}
|
|
@@ -3176,7 +3221,7 @@ function OidcSection(param) {
|
|
|
3176
3221
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3177
3222
|
filter: {
|
|
3178
3223
|
nodes: flow.ui.nodes,
|
|
3179
|
-
groups:
|
|
3224
|
+
groups: UiNodeGroupEnum.Oidc,
|
|
3180
3225
|
attributes: "submit"
|
|
3181
3226
|
}
|
|
3182
3227
|
})
|
|
@@ -3238,12 +3283,10 @@ function _object_spread_props$6(target, source) {
|
|
|
3238
3283
|
}
|
|
3239
3284
|
function PasswordlessSection(param) {
|
|
3240
3285
|
var flow = param.flow, PasswordlessSectionWrapper = param.PasswordlessSectionWrapper;
|
|
3241
|
-
if (!
|
|
3286
|
+
if (!hasPasskey(flow.ui.nodes)) return null;
|
|
3242
3287
|
var filter = {
|
|
3243
3288
|
nodes: flow.ui.nodes,
|
|
3244
|
-
groups:
|
|
3245
|
-
"webauthn"
|
|
3246
|
-
],
|
|
3289
|
+
groups: UiNodeGroupEnum.Passkey,
|
|
3247
3290
|
withoutDefaultAttributes: true
|
|
3248
3291
|
};
|
|
3249
3292
|
return /*#__PURE__*/ jsxs(PasswordlessSectionWrapper, {
|
|
@@ -3270,6 +3313,52 @@ function PasswordlessSection(param) {
|
|
|
3270
3313
|
});
|
|
3271
3314
|
}
|
|
3272
3315
|
|
|
3316
|
+
function ProfileLoginSection(param) {
|
|
3317
|
+
var nodes = param.nodes, ProfileLoginSectionWrapper = param.ProfileLoginSectionWrapper;
|
|
3318
|
+
return /*#__PURE__*/ jsxs(ProfileLoginSectionWrapper, {
|
|
3319
|
+
children: [
|
|
3320
|
+
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3321
|
+
filter: {
|
|
3322
|
+
nodes: nodes,
|
|
3323
|
+
groups: UiNodeGroupEnum.Profile,
|
|
3324
|
+
excludeAttributes: "submit,hidden"
|
|
3325
|
+
}
|
|
3326
|
+
}),
|
|
3327
|
+
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3328
|
+
filter: {
|
|
3329
|
+
nodes: nodes,
|
|
3330
|
+
groups: UiNodeGroupEnum.Profile,
|
|
3331
|
+
excludeAttributes: "hidden",
|
|
3332
|
+
attributes: "submit"
|
|
3333
|
+
}
|
|
3334
|
+
})
|
|
3335
|
+
]
|
|
3336
|
+
});
|
|
3337
|
+
}
|
|
3338
|
+
|
|
3339
|
+
function ProfileRegistrationSection(param) {
|
|
3340
|
+
var nodes = param.nodes, ProfileRegistrationSectionWrapper = param.ProfileRegistrationSectionWrapper;
|
|
3341
|
+
return /*#__PURE__*/ jsxs(ProfileRegistrationSectionWrapper, {
|
|
3342
|
+
children: [
|
|
3343
|
+
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3344
|
+
filter: {
|
|
3345
|
+
nodes: nodes,
|
|
3346
|
+
groups: UiNodeGroupEnum.Profile,
|
|
3347
|
+
excludeAttributes: "submit,hidden"
|
|
3348
|
+
}
|
|
3349
|
+
}),
|
|
3350
|
+
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3351
|
+
filter: {
|
|
3352
|
+
nodes: nodes,
|
|
3353
|
+
groups: UiNodeGroupEnum.Profile,
|
|
3354
|
+
excludeAttributes: "hidden",
|
|
3355
|
+
attributes: "submit"
|
|
3356
|
+
}
|
|
3357
|
+
})
|
|
3358
|
+
]
|
|
3359
|
+
});
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3273
3362
|
function _define_property$6(obj, key, value) {
|
|
3274
3363
|
if (key in obj) {
|
|
3275
3364
|
Object.defineProperty(obj, key, {
|
|
@@ -3327,19 +3416,18 @@ function RegistrationSection(param) {
|
|
|
3327
3416
|
if (!hasPassword(nodes)) return null;
|
|
3328
3417
|
var filter = {
|
|
3329
3418
|
nodes: nodes,
|
|
3330
|
-
groups:
|
|
3331
|
-
"password"
|
|
3332
|
-
]
|
|
3419
|
+
groups: UiNodeGroupEnum.Password
|
|
3333
3420
|
};
|
|
3334
3421
|
return /*#__PURE__*/ jsxs(RegistrationSectionWrapper, {
|
|
3335
3422
|
children: [
|
|
3336
3423
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3337
3424
|
filter: _object_spread_props$5(_object_spread$6({}, filter), {
|
|
3338
|
-
excludeAttributes: "submit"
|
|
3425
|
+
excludeAttributes: "submit,hidden"
|
|
3339
3426
|
})
|
|
3340
3427
|
}),
|
|
3341
3428
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3342
3429
|
filter: _object_spread_props$5(_object_spread$6({}, filter), {
|
|
3430
|
+
excludeAttributes: "hidden",
|
|
3343
3431
|
attributes: "submit"
|
|
3344
3432
|
})
|
|
3345
3433
|
})
|
|
@@ -3400,7 +3488,7 @@ function _object_spread$5(target) {
|
|
|
3400
3488
|
* @returns JSX.Element
|
|
3401
3489
|
*/ function UserAuthCard(param) {
|
|
3402
3490
|
var flow = param.flow, flowType = param.flowType, onSubmit = param.onSubmit, className = param.className;
|
|
3403
|
-
var _useKratosContext = useKratosContext(), _useKratosContext_components = _useKratosContext.components, PasswordlessSectionWrapper = _useKratosContext_components.PasswordlessSectionWrapper, OidcSectionWrapper = _useKratosContext_components.OidcSectionWrapper, AuthCodeSectionWrapper = _useKratosContext_components.AuthCodeSectionWrapper, LoginSectionWrapper = _useKratosContext_components.LoginSectionWrapper, RegistrationSectionWrapper = _useKratosContext_components.RegistrationSectionWrapper, UiMessages = _useKratosContext_components.UiMessages, LinkSectionWrapper = _useKratosContext_components.LinkSectionWrapper, excludeScripts = _useKratosContext.excludeScripts;
|
|
3491
|
+
var _useKratosContext = useKratosContext(), _useKratosContext_components = _useKratosContext.components, PasswordlessSectionWrapper = _useKratosContext_components.PasswordlessSectionWrapper, OidcSectionWrapper = _useKratosContext_components.OidcSectionWrapper, AuthCodeSectionWrapper = _useKratosContext_components.AuthCodeSectionWrapper, LoginSectionWrapper = _useKratosContext_components.LoginSectionWrapper, RegistrationSectionWrapper = _useKratosContext_components.RegistrationSectionWrapper, UiMessages = _useKratosContext_components.UiMessages, LinkSectionWrapper = _useKratosContext_components.LinkSectionWrapper, IdentifierFirstLoginSectionWrapper = _useKratosContext_components.IdentifierFirstLoginSectionWrapper, ProfileLoginSectionWrapper = _useKratosContext_components.ProfileLoginSectionWrapper, ProfileRegistrationSectionWrapper = _useKratosContext_components.ProfileRegistrationSectionWrapper, excludeScripts = _useKratosContext.excludeScripts;
|
|
3404
3492
|
useScriptNodes({
|
|
3405
3493
|
nodes: flow.ui.nodes,
|
|
3406
3494
|
excludeScripts: excludeScripts
|
|
@@ -3408,17 +3496,19 @@ function _object_spread$5(target) {
|
|
|
3408
3496
|
var $flow = undefined;
|
|
3409
3497
|
var $oidc = undefined;
|
|
3410
3498
|
var $code = undefined;
|
|
3411
|
-
var $
|
|
3499
|
+
var $passkey = undefined;
|
|
3500
|
+
var $twoStep = undefined;
|
|
3501
|
+
var $profile = undefined;
|
|
3412
3502
|
// the current flow is a two factor flow if the user is logged in and has any of the second factor methods enabled.
|
|
3413
|
-
var isTwoFactor = flowType === "login" && isLoggedIn(flow) && (hasTotp(flow.ui.nodes) ||
|
|
3503
|
+
var isTwoFactor = flowType === "login" && isLoggedIn(flow) && (hasTotp(flow.ui.nodes) || hasPasskey(flow.ui.nodes) || hasLookupSecret(flow.ui.nodes));
|
|
3414
3504
|
// This array contains all the 2fa flows mapped to their own respective forms.
|
|
3415
3505
|
var twoFactorFlows = isTwoFactor && [
|
|
3416
|
-
|
|
3506
|
+
hasPasskey(flow.ui.nodes) && /*#__PURE__*/ jsx(UserAuthForm, {
|
|
3417
3507
|
flow: flow,
|
|
3418
3508
|
children: /*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3419
3509
|
filter: {
|
|
3420
3510
|
nodes: flow.ui.nodes,
|
|
3421
|
-
groups:
|
|
3511
|
+
groups: UiNodeGroupEnum.Passkey,
|
|
3422
3512
|
withoutDefaultGroup: true
|
|
3423
3513
|
}
|
|
3424
3514
|
})
|
|
@@ -3428,7 +3518,17 @@ function _object_spread$5(target) {
|
|
|
3428
3518
|
children: /*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3429
3519
|
filter: {
|
|
3430
3520
|
nodes: flow.ui.nodes,
|
|
3431
|
-
groups:
|
|
3521
|
+
groups: UiNodeGroupEnum.Password,
|
|
3522
|
+
withoutDefaultGroup: true
|
|
3523
|
+
}
|
|
3524
|
+
})
|
|
3525
|
+
}),
|
|
3526
|
+
hasProfile(flow.ui.nodes) && /*#__PURE__*/ jsx(UserAuthForm, {
|
|
3527
|
+
flow: flow,
|
|
3528
|
+
children: /*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3529
|
+
filter: {
|
|
3530
|
+
nodes: flow.ui.nodes,
|
|
3531
|
+
groups: UiNodeGroupEnum.Profile,
|
|
3432
3532
|
withoutDefaultGroup: true
|
|
3433
3533
|
}
|
|
3434
3534
|
})
|
|
@@ -3441,7 +3541,7 @@ function _object_spread$5(target) {
|
|
|
3441
3541
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3442
3542
|
filter: {
|
|
3443
3543
|
nodes: flow.ui.nodes,
|
|
3444
|
-
groups:
|
|
3544
|
+
groups: UiNodeGroupEnum.Totp,
|
|
3445
3545
|
withoutDefaultGroup: true,
|
|
3446
3546
|
excludeAttributes: "submit"
|
|
3447
3547
|
}
|
|
@@ -3449,7 +3549,7 @@ function _object_spread$5(target) {
|
|
|
3449
3549
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3450
3550
|
filter: {
|
|
3451
3551
|
nodes: flow.ui.nodes,
|
|
3452
|
-
groups:
|
|
3552
|
+
groups: UiNodeGroupEnum.Totp,
|
|
3453
3553
|
withoutDefaultGroup: true,
|
|
3454
3554
|
attributes: "submit"
|
|
3455
3555
|
}
|
|
@@ -3463,7 +3563,7 @@ function _object_spread$5(target) {
|
|
|
3463
3563
|
children: /*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3464
3564
|
filter: {
|
|
3465
3565
|
nodes: flow.ui.nodes,
|
|
3466
|
-
groups:
|
|
3566
|
+
groups: UiNodeGroupEnum.LookupSecret,
|
|
3467
3567
|
withoutDefaultGroup: true
|
|
3468
3568
|
}
|
|
3469
3569
|
})
|
|
@@ -3472,28 +3572,40 @@ function _object_spread$5(target) {
|
|
|
3472
3572
|
;
|
|
3473
3573
|
switch(flowType){
|
|
3474
3574
|
case "login":
|
|
3475
|
-
$passwordless = hasWebauthn(flow.ui.nodes) ? /*#__PURE__*/ jsx(PasswordlessSection, {
|
|
3476
|
-
flow: flow,
|
|
3477
|
-
PasswordlessSectionWrapper: PasswordlessSectionWrapper
|
|
3478
|
-
}) : undefined;
|
|
3479
3575
|
$oidc = hasOidc(flow.ui.nodes) ? /*#__PURE__*/ jsx(OidcSection, {
|
|
3480
3576
|
flow: flow,
|
|
3481
3577
|
OidcSectionWrapper: OidcSectionWrapper
|
|
3482
3578
|
}) : undefined;
|
|
3483
|
-
$
|
|
3484
|
-
|
|
3579
|
+
$passkey = hasPasskey(flow.ui.nodes) ? /*#__PURE__*/ jsx(PasswordlessSection, {
|
|
3580
|
+
flow: flow,
|
|
3581
|
+
PasswordlessSectionWrapper: PasswordlessSectionWrapper
|
|
3582
|
+
}) : undefined;
|
|
3583
|
+
$twoStep = hasIdentifierFirst(flow.ui.nodes) ? /*#__PURE__*/ jsx(IdentifierFirstLoginSection, {
|
|
3584
|
+
IdentifierFirstLoginSectionWrapper: IdentifierFirstLoginSectionWrapper,
|
|
3485
3585
|
nodes: flow.ui.nodes
|
|
3486
3586
|
}) : undefined;
|
|
3587
|
+
$profile = hasProfile(flow.ui.nodes) ? /*#__PURE__*/ jsx(ProfileLoginSection, {
|
|
3588
|
+
nodes: flow.ui.nodes,
|
|
3589
|
+
ProfileLoginSectionWrapper: ProfileLoginSectionWrapper
|
|
3590
|
+
}) : undefined;
|
|
3487
3591
|
$flow = hasPassword(flow.ui.nodes) ? /*#__PURE__*/ jsx(LoginSection, {
|
|
3488
3592
|
LoginSectionWrapper: LoginSectionWrapper,
|
|
3489
3593
|
nodes: flow.ui.nodes
|
|
3490
3594
|
}) : undefined;
|
|
3595
|
+
$code = hasCode(flow.ui.nodes) ? /*#__PURE__*/ jsx(AuthCodeSection, {
|
|
3596
|
+
AuthCodeSectionWrapper: AuthCodeSectionWrapper,
|
|
3597
|
+
nodes: flow.ui.nodes
|
|
3598
|
+
}) : undefined;
|
|
3491
3599
|
break;
|
|
3492
3600
|
case "registration":
|
|
3493
|
-
$
|
|
3601
|
+
$passkey = hasPasskey(flow.ui.nodes) ? /*#__PURE__*/ jsx(PasswordlessSection, {
|
|
3494
3602
|
flow: flow,
|
|
3495
3603
|
PasswordlessSectionWrapper: PasswordlessSectionWrapper
|
|
3496
3604
|
}) : undefined;
|
|
3605
|
+
$profile = hasProfile(flow.ui.nodes) ? /*#__PURE__*/ jsx(ProfileRegistrationSection, {
|
|
3606
|
+
nodes: flow.ui.nodes,
|
|
3607
|
+
ProfileRegistrationSectionWrapper: ProfileRegistrationSectionWrapper
|
|
3608
|
+
}) : undefined;
|
|
3497
3609
|
$oidc = hasOidc(flow.ui.nodes) ? /*#__PURE__*/ jsx(OidcSection, {
|
|
3498
3610
|
flow: flow,
|
|
3499
3611
|
OidcSectionWrapper: OidcSectionWrapper
|
|
@@ -3502,7 +3614,7 @@ function _object_spread$5(target) {
|
|
|
3502
3614
|
AuthCodeSectionWrapper: AuthCodeSectionWrapper,
|
|
3503
3615
|
nodes: flow.ui.nodes
|
|
3504
3616
|
}) : undefined;
|
|
3505
|
-
$flow = hasPassword(flow.ui.nodes) ? /*#__PURE__*/ jsx(RegistrationSection, {
|
|
3617
|
+
$flow = hasDefault(flow.ui.nodes) || hasPassword(flow.ui.nodes) ? /*#__PURE__*/ jsx(RegistrationSection, {
|
|
3506
3618
|
nodes: flow.ui.nodes,
|
|
3507
3619
|
RegistrationSectionWrapper: RegistrationSectionWrapper
|
|
3508
3620
|
}) : undefined;
|
|
@@ -3516,9 +3628,8 @@ function _object_spread$5(target) {
|
|
|
3516
3628
|
});
|
|
3517
3629
|
break;
|
|
3518
3630
|
}
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
var canShowPasswordless = !!$passwordless && (!isLoggedIn(flow) || flowType === "registration");
|
|
3631
|
+
var canShowPasskey = !!$passkey && (!isLoggedIn(flow) || flowType === "registration");
|
|
3632
|
+
var canShowProfile = !!$profile && hasProfile(flow.ui.nodes);
|
|
3522
3633
|
return /*#__PURE__*/ jsxs("div", {
|
|
3523
3634
|
className: className,
|
|
3524
3635
|
children: [
|
|
@@ -3529,6 +3640,16 @@ function _object_spread$5(target) {
|
|
|
3529
3640
|
flow: flow,
|
|
3530
3641
|
children: $oidc
|
|
3531
3642
|
}),
|
|
3643
|
+
$twoStep && /*#__PURE__*/ jsx(UserAuthForm, {
|
|
3644
|
+
flow: flow,
|
|
3645
|
+
children: $twoStep
|
|
3646
|
+
}),
|
|
3647
|
+
canShowPasskey && /*#__PURE__*/ jsx(UserAuthForm, {
|
|
3648
|
+
submitOnEnter: true,
|
|
3649
|
+
flow: flow,
|
|
3650
|
+
onSubmit: onSubmit,
|
|
3651
|
+
children: $passkey
|
|
3652
|
+
}),
|
|
3532
3653
|
$code && /*#__PURE__*/ jsx(UserAuthForm, {
|
|
3533
3654
|
flow: flow,
|
|
3534
3655
|
children: $code
|
|
@@ -3539,16 +3660,26 @@ function _object_spread$5(target) {
|
|
|
3539
3660
|
onSubmit: onSubmit,
|
|
3540
3661
|
children: $flow
|
|
3541
3662
|
}),
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3663
|
+
isTwoFactor && /*#__PURE__*/ jsxs(Fragment, {
|
|
3664
|
+
children: [
|
|
3665
|
+
/*#__PURE__*/ jsx(NodeMessages, {
|
|
3666
|
+
nodes: filterNodesByGroups({
|
|
3667
|
+
nodes: flow.ui.nodes,
|
|
3668
|
+
groups: [
|
|
3669
|
+
UiNodeGroupEnum.Password,
|
|
3670
|
+
UiNodeGroupEnum.Webauthn,
|
|
3671
|
+
UiNodeGroupEnum.Passkey,
|
|
3672
|
+
UiNodeGroupEnum.Totp,
|
|
3673
|
+
UiNodeGroupEnum.LookupSecret
|
|
3674
|
+
]
|
|
3675
|
+
})
|
|
3676
|
+
}),
|
|
3677
|
+
twoFactorFlows
|
|
3678
|
+
]
|
|
3679
|
+
}),
|
|
3680
|
+
canShowProfile && /*#__PURE__*/ jsx(UserAuthForm, {
|
|
3545
3681
|
flow: flow,
|
|
3546
|
-
|
|
3547
|
-
nodes: flow.ui.nodes,
|
|
3548
|
-
attributes: "hidden"
|
|
3549
|
-
},
|
|
3550
|
-
onSubmit: onSubmit,
|
|
3551
|
-
children: $passwordless
|
|
3682
|
+
children: $profile
|
|
3552
3683
|
})
|
|
3553
3684
|
]
|
|
3554
3685
|
});
|
|
@@ -3631,7 +3762,7 @@ function LookupSecretSettingsSection(param) {
|
|
|
3631
3762
|
var flow = param.flow, LookupSecretSettingsSectionWrapper = param.LookupSecretSettingsSectionWrapper;
|
|
3632
3763
|
var filter = {
|
|
3633
3764
|
nodes: flow.ui.nodes,
|
|
3634
|
-
groups:
|
|
3765
|
+
groups: UiNodeGroupEnum.LookupSecret,
|
|
3635
3766
|
withoutDefaultGroup: true
|
|
3636
3767
|
};
|
|
3637
3768
|
if (!hasLookupSecret(flow.ui.nodes)) return null;
|
|
@@ -3658,7 +3789,7 @@ function OidcSettingsSection(param) {
|
|
|
3658
3789
|
children: /*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3659
3790
|
filter: {
|
|
3660
3791
|
nodes: flow.ui.nodes,
|
|
3661
|
-
groups:
|
|
3792
|
+
groups: UiNodeGroupEnum.Oidc,
|
|
3662
3793
|
withoutDefaultGroup: true
|
|
3663
3794
|
}
|
|
3664
3795
|
})
|
|
@@ -3717,15 +3848,15 @@ function _object_spread_props$3(target, source) {
|
|
|
3717
3848
|
}
|
|
3718
3849
|
return target;
|
|
3719
3850
|
}
|
|
3720
|
-
function
|
|
3721
|
-
var flow = param.flow,
|
|
3722
|
-
if (!
|
|
3851
|
+
function PasskeySettingsSection(param) {
|
|
3852
|
+
var flow = param.flow, PasskeySettingsSectionWrapper = param.PasskeySettingsSectionWrapper;
|
|
3853
|
+
if (!hasPasskey(flow.ui.nodes)) return null;
|
|
3723
3854
|
var filter = {
|
|
3724
3855
|
nodes: flow.ui.nodes,
|
|
3725
|
-
groups:
|
|
3856
|
+
groups: UiNodeGroupEnum.Passkey,
|
|
3726
3857
|
withoutDefaultGroup: true
|
|
3727
3858
|
};
|
|
3728
|
-
return /*#__PURE__*/ jsxs(
|
|
3859
|
+
return /*#__PURE__*/ jsxs(PasskeySettingsSectionWrapper, {
|
|
3729
3860
|
children: [
|
|
3730
3861
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3731
3862
|
filter: _object_spread_props$3(_object_spread$3({}, filter), {
|
|
@@ -3793,13 +3924,15 @@ function _object_spread_props$2(target, source) {
|
|
|
3793
3924
|
}
|
|
3794
3925
|
return target;
|
|
3795
3926
|
}
|
|
3796
|
-
function
|
|
3797
|
-
var flow = param.flow,
|
|
3927
|
+
function PasswordSettingsSection(param) {
|
|
3928
|
+
var flow = param.flow, PasswordSettingsSectionWrapper = param.PasswordSettingsSectionWrapper;
|
|
3929
|
+
if (!hasPassword(flow.ui.nodes)) return null;
|
|
3798
3930
|
var filter = {
|
|
3799
3931
|
nodes: flow.ui.nodes,
|
|
3800
|
-
groups:
|
|
3932
|
+
groups: UiNodeGroupEnum.Password,
|
|
3933
|
+
withoutDefaultGroup: true
|
|
3801
3934
|
};
|
|
3802
|
-
return /*#__PURE__*/ jsxs(
|
|
3935
|
+
return /*#__PURE__*/ jsxs(PasswordSettingsSectionWrapper, {
|
|
3803
3936
|
children: [
|
|
3804
3937
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3805
3938
|
filter: _object_spread_props$2(_object_spread$2({}, filter), {
|
|
@@ -3867,15 +4000,13 @@ function _object_spread_props$1(target, source) {
|
|
|
3867
4000
|
}
|
|
3868
4001
|
return target;
|
|
3869
4002
|
}
|
|
3870
|
-
function
|
|
3871
|
-
var flow = param.flow,
|
|
3872
|
-
if (!hasTotp(flow.ui.nodes)) return null;
|
|
4003
|
+
function ProfileSettingsSection(param) {
|
|
4004
|
+
var flow = param.flow, ProfileSettingsSectionWrapper = param.ProfileSettingsSectionWrapper;
|
|
3873
4005
|
var filter = {
|
|
3874
4006
|
nodes: flow.ui.nodes,
|
|
3875
|
-
groups:
|
|
3876
|
-
withoutDefaultGroup: true
|
|
4007
|
+
groups: UiNodeGroupEnum.Profile
|
|
3877
4008
|
};
|
|
3878
|
-
return /*#__PURE__*/ jsxs(
|
|
4009
|
+
return /*#__PURE__*/ jsxs(ProfileSettingsSectionWrapper, {
|
|
3879
4010
|
children: [
|
|
3880
4011
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3881
4012
|
filter: _object_spread_props$1(_object_spread$1({}, filter), {
|
|
@@ -3943,15 +4074,15 @@ function _object_spread_props(target, source) {
|
|
|
3943
4074
|
}
|
|
3944
4075
|
return target;
|
|
3945
4076
|
}
|
|
3946
|
-
function
|
|
3947
|
-
var flow = param.flow,
|
|
3948
|
-
if (!
|
|
4077
|
+
function TotpSettingsSection(param) {
|
|
4078
|
+
var flow = param.flow, TotpSettingsSectionWrapper = param.TotpSettingsSectionWrapper;
|
|
4079
|
+
if (!hasTotp(flow.ui.nodes)) return null;
|
|
3949
4080
|
var filter = {
|
|
3950
4081
|
nodes: flow.ui.nodes,
|
|
3951
|
-
groups:
|
|
4082
|
+
groups: UiNodeGroupEnum.Totp,
|
|
3952
4083
|
withoutDefaultGroup: true
|
|
3953
4084
|
};
|
|
3954
|
-
return /*#__PURE__*/ jsxs(
|
|
4085
|
+
return /*#__PURE__*/ jsxs(TotpSettingsSectionWrapper, {
|
|
3955
4086
|
children: [
|
|
3956
4087
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3957
4088
|
filter: _object_spread_props(_object_spread({}, filter), {
|
|
@@ -3975,32 +4106,32 @@ function UserSettingsCard(param) {
|
|
|
3975
4106
|
excludeScripts: excludeScripts
|
|
3976
4107
|
});
|
|
3977
4108
|
var $flow = function() {
|
|
3978
|
-
if (flowType ===
|
|
4109
|
+
if (flowType === UiNodeGroupEnum.Profile) {
|
|
3979
4110
|
return /*#__PURE__*/ jsx(ProfileSettingsSection, {
|
|
3980
4111
|
flow: flow,
|
|
3981
4112
|
ProfileSettingsSectionWrapper: ProfileSettingsSectionWrapper
|
|
3982
4113
|
});
|
|
3983
|
-
} else if (flowType ===
|
|
4114
|
+
} else if (flowType === UiNodeGroupEnum.Password && hasPassword(flow.ui.nodes)) {
|
|
3984
4115
|
return /*#__PURE__*/ jsx(PasswordSettingsSection, {
|
|
3985
4116
|
flow: flow,
|
|
3986
4117
|
PasswordSettingsSectionWrapper: PasswordSettingsSectionWrapper
|
|
3987
4118
|
});
|
|
3988
|
-
} else if (flowType ===
|
|
3989
|
-
return /*#__PURE__*/ jsx(
|
|
4119
|
+
} else if (flowType === UiNodeGroupEnum.Passkey && hasPasskey(flow.ui.nodes)) {
|
|
4120
|
+
return /*#__PURE__*/ jsx(PasskeySettingsSection, {
|
|
3990
4121
|
flow: flow,
|
|
3991
|
-
|
|
4122
|
+
PasskeySettingsSectionWrapper: WebAuthnSettingsSectionWrapper
|
|
3992
4123
|
});
|
|
3993
|
-
} else if (flowType ===
|
|
4124
|
+
} else if (flowType === UiNodeGroupEnum.LookupSecret && hasLookupSecret(flow.ui.nodes)) {
|
|
3994
4125
|
return /*#__PURE__*/ jsx(LookupSecretSettingsSection, {
|
|
3995
4126
|
flow: flow,
|
|
3996
4127
|
LookupSecretSettingsSectionWrapper: LookupSecretSettingsSectionWrapper
|
|
3997
4128
|
});
|
|
3998
|
-
} else if (flowType ===
|
|
4129
|
+
} else if (flowType === UiNodeGroupEnum.Oidc && hasOidc(flow.ui.nodes)) {
|
|
3999
4130
|
return /*#__PURE__*/ jsx(OidcSettingsSection, {
|
|
4000
4131
|
flow: flow,
|
|
4001
4132
|
OidcSettingsSectionWrapper: OidcSettingsSectionWrapper
|
|
4002
4133
|
});
|
|
4003
|
-
} else if (flowType ===
|
|
4134
|
+
} else if (flowType === UiNodeGroupEnum.Totp && hasTotp(flow.ui.nodes)) {
|
|
4004
4135
|
return /*#__PURE__*/ jsx(TotpSettingsSection, {
|
|
4005
4136
|
flow: flow,
|
|
4006
4137
|
TotpSettingsSectionWrapper: TotpSettingsSectionWrapper
|