@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 CHANGED
@@ -829,7 +829,10 @@ var defaultComponents = {
829
829
  WebAuthnSettingsSectionWrapper: "div",
830
830
  LookupSecretSettingsSectionWrapper: "div",
831
831
  OidcSettingsSectionWrapper: "div",
832
- TotpSettingsSectionWrapper: "div"
832
+ TotpSettingsSectionWrapper: "div",
833
+ IdentifierFirstLoginSectionWrapper: "div",
834
+ ProfileLoginSectionWrapper: "div",
835
+ ProfileRegistrationSectionWrapper: "div"
833
836
  };
834
837
 
835
838
  function _define_property$d(obj, key, value) {
@@ -2523,17 +2526,17 @@ function getNodeInputType(attr) {
2523
2526
  if (!groups && !attributes && !excludeAttributes) return true;
2524
2527
  var g = search(groups);
2525
2528
  if (!withoutDefaultGroup) {
2526
- g.push("default");
2529
+ g.push(client.UiNodeGroupEnum.Default);
2527
2530
  }
2528
2531
  // filter the attributes
2529
2532
  var a = search(attributes);
2530
2533
  if (!withoutDefaultAttributes) {
2531
2534
  // always add hidden fields e.g. csrf
2532
- if (group.includes("default")) {
2535
+ if (group.includes(client.UiNodeGroupEnum.Default)) {
2533
2536
  a.push("hidden");
2534
2537
  }
2535
2538
  // automatically add the necessary fields for webauthn and totp
2536
- if (group.includes("webauthn") || group.includes("totp")) {
2539
+ if (group.includes(client.UiNodeGroupEnum.Webauthn) || group.includes(client.UiNodeGroupEnum.Totp)) {
2537
2540
  a.push("input", "script");
2538
2541
  }
2539
2542
  }
@@ -2626,7 +2629,7 @@ function Node(param) {
2626
2629
  case "submit":
2627
2630
  {
2628
2631
  var _node_meta_label;
2629
- var isSocial = (attrs.name === "provider" || attrs.name === "link") && node.group === "oidc";
2632
+ var isSocial = (attrs.name === "provider" || attrs.name === "link") && node.group === client.UiNodeGroupEnum.Oidc;
2630
2633
  var submit = {
2631
2634
  type: attrs.type,
2632
2635
  name: attrs.name
@@ -2840,7 +2843,7 @@ function useScriptNodes(param) {
2840
2843
  }
2841
2844
  var scriptNodes = filterNodesByGroups({
2842
2845
  nodes: nodes,
2843
- groups: "webauthn",
2846
+ groups: client.UiNodeGroupEnum.Webauthn,
2844
2847
  attributes: "text/javascript",
2845
2848
  withoutDefaultGroup: true,
2846
2849
  withoutDefaultAttributes: true
@@ -3000,7 +3003,7 @@ function _object_without_properties_loose(source, excluded) {
3000
3003
  includeCSRF: true,
3001
3004
  filter: formFilterOverride !== null && formFilterOverride !== void 0 ? formFilterOverride : {
3002
3005
  nodes: flow.ui.nodes,
3003
- groups: "default",
3006
+ groups: client.UiNodeGroupEnum.Default,
3004
3007
  attributes: "hidden"
3005
3008
  }
3006
3009
  }),
@@ -3012,37 +3015,55 @@ function _object_without_properties_loose(source, excluded) {
3012
3015
  function hasOidc(nodes) {
3013
3016
  return nodes.some(function(param) {
3014
3017
  var group = param.group;
3015
- return group === "oidc";
3018
+ return group === client.UiNodeGroupEnum.Oidc;
3016
3019
  });
3017
3020
  }
3018
3021
  function hasPassword(nodes) {
3019
3022
  return nodes.some(function(param) {
3020
3023
  var group = param.group;
3021
- return group === "password";
3024
+ return group === client.UiNodeGroupEnum.Password;
3022
3025
  });
3023
3026
  }
3024
- function hasWebauthn(nodes) {
3027
+ function hasDefault(nodes) {
3025
3028
  return nodes.some(function(param) {
3026
3029
  var group = param.group;
3027
- return group === "webauthn";
3030
+ return group === client.UiNodeGroupEnum.Default;
3031
+ });
3032
+ }
3033
+ function hasProfile(nodes) {
3034
+ return nodes.some(function(param) {
3035
+ var group = param.group;
3036
+ return group === client.UiNodeGroupEnum.Profile;
3037
+ });
3038
+ }
3039
+ function hasPasskey(nodes) {
3040
+ return nodes.some(function(param) {
3041
+ var group = param.group;
3042
+ return group === client.UiNodeGroupEnum.Passkey;
3043
+ });
3044
+ }
3045
+ function hasIdentifierFirst(nodes) {
3046
+ return nodes.some(function(param) {
3047
+ var group = param.group;
3048
+ return group === client.UiNodeGroupEnum.IdentifierFirst;
3028
3049
  });
3029
3050
  }
3030
3051
  function hasLookupSecret(nodes) {
3031
3052
  return nodes.some(function(param) {
3032
3053
  var group = param.group;
3033
- return group === "lookup_secret";
3054
+ return group === client.UiNodeGroupEnum.LookupSecret;
3034
3055
  });
3035
3056
  }
3036
3057
  function hasTotp(nodes) {
3037
3058
  return nodes.some(function(param) {
3038
3059
  var group = param.group;
3039
- return group === "totp";
3060
+ return group === client.UiNodeGroupEnum.Totp;
3040
3061
  });
3041
3062
  }
3042
3063
  function hasCode(nodes) {
3043
3064
  return nodes.some(function(param) {
3044
3065
  var group = param.group;
3045
- return group === "code";
3066
+ return group === client.UiNodeGroupEnum.Code;
3046
3067
  });
3047
3068
  }
3048
3069
 
@@ -3059,9 +3080,7 @@ function hasCode(nodes) {
3059
3080
  /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3060
3081
  filter: {
3061
3082
  nodes: nodes,
3062
- groups: [
3063
- "code"
3064
- ],
3083
+ groups: client.UiNodeGroupEnum.Code,
3065
3084
  // we don't want to map the default group twice
3066
3085
  // the form already maps hidden fields under the default group
3067
3086
  // we are only interested in hidden fields that are under the code group
@@ -3075,7 +3094,7 @@ function hasCode(nodes) {
3075
3094
  /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3076
3095
  filter: {
3077
3096
  nodes: nodes,
3078
- groups: "code",
3097
+ groups: client.UiNodeGroupEnum.Code,
3079
3098
  withoutDefaultAttributes: true,
3080
3099
  excludeAttributes: [
3081
3100
  "hidden",
@@ -3087,7 +3106,7 @@ function hasCode(nodes) {
3087
3106
  /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3088
3107
  filter: {
3089
3108
  nodes: nodes,
3090
- groups: "code",
3109
+ groups: client.UiNodeGroupEnum.Code,
3091
3110
  withoutDefaultAttributes: true,
3092
3111
  attributes: [
3093
3112
  "button",
@@ -3099,6 +3118,34 @@ function hasCode(nodes) {
3099
3118
  });
3100
3119
  }
3101
3120
 
3121
+ function IdentifierFirstLoginSection(param) {
3122
+ var nodes = param.nodes, IdentifierFirstLoginSectionWrapper = param.IdentifierFirstLoginSectionWrapper;
3123
+ return /*#__PURE__*/ jsxRuntime.jsxs(IdentifierFirstLoginSectionWrapper, {
3124
+ children: [
3125
+ /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3126
+ filter: {
3127
+ nodes: nodes,
3128
+ groups: [
3129
+ client.UiNodeGroupEnum.Default,
3130
+ client.UiNodeGroupEnum.IdentifierFirst
3131
+ ],
3132
+ excludeAttributes: [
3133
+ "submit",
3134
+ "hidden"
3135
+ ]
3136
+ }
3137
+ }),
3138
+ /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3139
+ filter: {
3140
+ nodes: nodes,
3141
+ groups: client.UiNodeGroupEnum.IdentifierFirst,
3142
+ attributes: "submit"
3143
+ }
3144
+ })
3145
+ ]
3146
+ });
3147
+ }
3148
+
3102
3149
  /**
3103
3150
  * LinkSection renders the fields for recovery and verification
3104
3151
  * Please see the Ory docs for more information:
@@ -3112,8 +3159,8 @@ function hasCode(nodes) {
3112
3159
  filter: {
3113
3160
  nodes: nodes,
3114
3161
  groups: [
3115
- "link",
3116
- "code"
3162
+ client.UiNodeGroupEnum.Link,
3163
+ client.UiNodeGroupEnum.Code
3117
3164
  ],
3118
3165
  excludeAttributes: "submit"
3119
3166
  }
@@ -3122,8 +3169,8 @@ function hasCode(nodes) {
3122
3169
  filter: {
3123
3170
  nodes: nodes,
3124
3171
  groups: [
3125
- "link",
3126
- "code"
3172
+ client.UiNodeGroupEnum.Link,
3173
+ client.UiNodeGroupEnum.Code
3127
3174
  ],
3128
3175
  attributes: "submit"
3129
3176
  }
@@ -3141,8 +3188,8 @@ function LoginSection(param) {
3141
3188
  filter: {
3142
3189
  nodes: nodes,
3143
3190
  groups: [
3144
- "default",
3145
- "password"
3191
+ client.UiNodeGroupEnum.Default,
3192
+ client.UiNodeGroupEnum.Password
3146
3193
  ],
3147
3194
  excludeAttributes: [
3148
3195
  "submit",
@@ -3153,9 +3200,7 @@ function LoginSection(param) {
3153
3200
  /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3154
3201
  filter: {
3155
3202
  nodes: nodes,
3156
- groups: [
3157
- "password"
3158
- ],
3203
+ groups: client.UiNodeGroupEnum.Password,
3159
3204
  attributes: "submit"
3160
3205
  }
3161
3206
  })
@@ -3168,7 +3213,7 @@ function OidcSection(param) {
3168
3213
  if (!hasOidc(flow.ui.nodes)) return null;
3169
3214
  var hasOidcTraits = filterNodesByGroups({
3170
3215
  nodes: flow.ui.nodes,
3171
- groups: "oidc",
3216
+ groups: client.UiNodeGroupEnum.Oidc,
3172
3217
  withoutDefaultGroup: true,
3173
3218
  excludeAttributes: "submit"
3174
3219
  }).length > 0;
@@ -3177,7 +3222,7 @@ function OidcSection(param) {
3177
3222
  hasOidcTraits && /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3178
3223
  filter: {
3179
3224
  nodes: flow.ui.nodes,
3180
- groups: "oidc",
3225
+ groups: client.UiNodeGroupEnum.Oidc,
3181
3226
  withoutDefaultGroup: true,
3182
3227
  excludeAttributes: "submit"
3183
3228
  }
@@ -3185,7 +3230,7 @@ function OidcSection(param) {
3185
3230
  /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3186
3231
  filter: {
3187
3232
  nodes: flow.ui.nodes,
3188
- groups: "oidc",
3233
+ groups: client.UiNodeGroupEnum.Oidc,
3189
3234
  attributes: "submit"
3190
3235
  }
3191
3236
  })
@@ -3247,12 +3292,10 @@ function _object_spread_props$6(target, source) {
3247
3292
  }
3248
3293
  function PasswordlessSection(param) {
3249
3294
  var flow = param.flow, PasswordlessSectionWrapper = param.PasswordlessSectionWrapper;
3250
- if (!hasWebauthn(flow.ui.nodes)) return null;
3295
+ if (!hasPasskey(flow.ui.nodes)) return null;
3251
3296
  var filter = {
3252
3297
  nodes: flow.ui.nodes,
3253
- groups: [
3254
- "webauthn"
3255
- ],
3298
+ groups: client.UiNodeGroupEnum.Passkey,
3256
3299
  withoutDefaultAttributes: true
3257
3300
  };
3258
3301
  return /*#__PURE__*/ jsxRuntime.jsxs(PasswordlessSectionWrapper, {
@@ -3279,6 +3322,52 @@ function PasswordlessSection(param) {
3279
3322
  });
3280
3323
  }
3281
3324
 
3325
+ function ProfileLoginSection(param) {
3326
+ var nodes = param.nodes, ProfileLoginSectionWrapper = param.ProfileLoginSectionWrapper;
3327
+ return /*#__PURE__*/ jsxRuntime.jsxs(ProfileLoginSectionWrapper, {
3328
+ children: [
3329
+ /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3330
+ filter: {
3331
+ nodes: nodes,
3332
+ groups: client.UiNodeGroupEnum.Profile,
3333
+ excludeAttributes: "submit,hidden"
3334
+ }
3335
+ }),
3336
+ /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3337
+ filter: {
3338
+ nodes: nodes,
3339
+ groups: client.UiNodeGroupEnum.Profile,
3340
+ excludeAttributes: "hidden",
3341
+ attributes: "submit"
3342
+ }
3343
+ })
3344
+ ]
3345
+ });
3346
+ }
3347
+
3348
+ function ProfileRegistrationSection(param) {
3349
+ var nodes = param.nodes, ProfileRegistrationSectionWrapper = param.ProfileRegistrationSectionWrapper;
3350
+ return /*#__PURE__*/ jsxRuntime.jsxs(ProfileRegistrationSectionWrapper, {
3351
+ children: [
3352
+ /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3353
+ filter: {
3354
+ nodes: nodes,
3355
+ groups: client.UiNodeGroupEnum.Profile,
3356
+ excludeAttributes: "submit,hidden"
3357
+ }
3358
+ }),
3359
+ /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3360
+ filter: {
3361
+ nodes: nodes,
3362
+ groups: client.UiNodeGroupEnum.Profile,
3363
+ excludeAttributes: "hidden",
3364
+ attributes: "submit"
3365
+ }
3366
+ })
3367
+ ]
3368
+ });
3369
+ }
3370
+
3282
3371
  function _define_property$6(obj, key, value) {
3283
3372
  if (key in obj) {
3284
3373
  Object.defineProperty(obj, key, {
@@ -3336,19 +3425,18 @@ function RegistrationSection(param) {
3336
3425
  if (!hasPassword(nodes)) return null;
3337
3426
  var filter = {
3338
3427
  nodes: nodes,
3339
- groups: [
3340
- "password"
3341
- ]
3428
+ groups: client.UiNodeGroupEnum.Password
3342
3429
  };
3343
3430
  return /*#__PURE__*/ jsxRuntime.jsxs(RegistrationSectionWrapper, {
3344
3431
  children: [
3345
3432
  /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3346
3433
  filter: _object_spread_props$5(_object_spread$6({}, filter), {
3347
- excludeAttributes: "submit"
3434
+ excludeAttributes: "submit,hidden"
3348
3435
  })
3349
3436
  }),
3350
3437
  /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3351
3438
  filter: _object_spread_props$5(_object_spread$6({}, filter), {
3439
+ excludeAttributes: "hidden",
3352
3440
  attributes: "submit"
3353
3441
  })
3354
3442
  })
@@ -3409,7 +3497,7 @@ function _object_spread$5(target) {
3409
3497
  * @returns JSX.Element
3410
3498
  */ function UserAuthCard(param) {
3411
3499
  var flow = param.flow, flowType = param.flowType, onSubmit = param.onSubmit, className = param.className;
3412
- 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;
3500
+ 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;
3413
3501
  useScriptNodes({
3414
3502
  nodes: flow.ui.nodes,
3415
3503
  excludeScripts: excludeScripts
@@ -3417,17 +3505,19 @@ function _object_spread$5(target) {
3417
3505
  var $flow = undefined;
3418
3506
  var $oidc = undefined;
3419
3507
  var $code = undefined;
3420
- var $passwordless = undefined;
3508
+ var $passkey = undefined;
3509
+ var $twoStep = undefined;
3510
+ var $profile = undefined;
3421
3511
  // the current flow is a two factor flow if the user is logged in and has any of the second factor methods enabled.
3422
- var isTwoFactor = flowType === "login" && isLoggedIn(flow) && (hasTotp(flow.ui.nodes) || hasWebauthn(flow.ui.nodes) || hasLookupSecret(flow.ui.nodes));
3512
+ var isTwoFactor = flowType === "login" && isLoggedIn(flow) && (hasTotp(flow.ui.nodes) || hasPasskey(flow.ui.nodes) || hasLookupSecret(flow.ui.nodes));
3423
3513
  // This array contains all the 2fa flows mapped to their own respective forms.
3424
3514
  var twoFactorFlows = isTwoFactor && [
3425
- hasWebauthn(flow.ui.nodes) && /*#__PURE__*/ jsxRuntime.jsx(UserAuthForm, {
3515
+ hasPasskey(flow.ui.nodes) && /*#__PURE__*/ jsxRuntime.jsx(UserAuthForm, {
3426
3516
  flow: flow,
3427
3517
  children: /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3428
3518
  filter: {
3429
3519
  nodes: flow.ui.nodes,
3430
- groups: "webauthn",
3520
+ groups: client.UiNodeGroupEnum.Passkey,
3431
3521
  withoutDefaultGroup: true
3432
3522
  }
3433
3523
  })
@@ -3437,7 +3527,17 @@ function _object_spread$5(target) {
3437
3527
  children: /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3438
3528
  filter: {
3439
3529
  nodes: flow.ui.nodes,
3440
- groups: "password",
3530
+ groups: client.UiNodeGroupEnum.Password,
3531
+ withoutDefaultGroup: true
3532
+ }
3533
+ })
3534
+ }),
3535
+ hasProfile(flow.ui.nodes) && /*#__PURE__*/ jsxRuntime.jsx(UserAuthForm, {
3536
+ flow: flow,
3537
+ children: /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3538
+ filter: {
3539
+ nodes: flow.ui.nodes,
3540
+ groups: client.UiNodeGroupEnum.Profile,
3441
3541
  withoutDefaultGroup: true
3442
3542
  }
3443
3543
  })
@@ -3450,7 +3550,7 @@ function _object_spread$5(target) {
3450
3550
  /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3451
3551
  filter: {
3452
3552
  nodes: flow.ui.nodes,
3453
- groups: "totp",
3553
+ groups: client.UiNodeGroupEnum.Totp,
3454
3554
  withoutDefaultGroup: true,
3455
3555
  excludeAttributes: "submit"
3456
3556
  }
@@ -3458,7 +3558,7 @@ function _object_spread$5(target) {
3458
3558
  /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3459
3559
  filter: {
3460
3560
  nodes: flow.ui.nodes,
3461
- groups: "totp",
3561
+ groups: client.UiNodeGroupEnum.Totp,
3462
3562
  withoutDefaultGroup: true,
3463
3563
  attributes: "submit"
3464
3564
  }
@@ -3472,7 +3572,7 @@ function _object_spread$5(target) {
3472
3572
  children: /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3473
3573
  filter: {
3474
3574
  nodes: flow.ui.nodes,
3475
- groups: "lookup_secret",
3575
+ groups: client.UiNodeGroupEnum.LookupSecret,
3476
3576
  withoutDefaultGroup: true
3477
3577
  }
3478
3578
  })
@@ -3481,28 +3581,40 @@ function _object_spread$5(target) {
3481
3581
  ;
3482
3582
  switch(flowType){
3483
3583
  case "login":
3484
- $passwordless = hasWebauthn(flow.ui.nodes) ? /*#__PURE__*/ jsxRuntime.jsx(PasswordlessSection, {
3485
- flow: flow,
3486
- PasswordlessSectionWrapper: PasswordlessSectionWrapper
3487
- }) : undefined;
3488
3584
  $oidc = hasOidc(flow.ui.nodes) ? /*#__PURE__*/ jsxRuntime.jsx(OidcSection, {
3489
3585
  flow: flow,
3490
3586
  OidcSectionWrapper: OidcSectionWrapper
3491
3587
  }) : undefined;
3492
- $code = hasCode(flow.ui.nodes) ? /*#__PURE__*/ jsxRuntime.jsx(AuthCodeSection, {
3493
- AuthCodeSectionWrapper: AuthCodeSectionWrapper,
3588
+ $passkey = hasPasskey(flow.ui.nodes) ? /*#__PURE__*/ jsxRuntime.jsx(PasswordlessSection, {
3589
+ flow: flow,
3590
+ PasswordlessSectionWrapper: PasswordlessSectionWrapper
3591
+ }) : undefined;
3592
+ $twoStep = hasIdentifierFirst(flow.ui.nodes) ? /*#__PURE__*/ jsxRuntime.jsx(IdentifierFirstLoginSection, {
3593
+ IdentifierFirstLoginSectionWrapper: IdentifierFirstLoginSectionWrapper,
3494
3594
  nodes: flow.ui.nodes
3495
3595
  }) : undefined;
3596
+ $profile = hasProfile(flow.ui.nodes) ? /*#__PURE__*/ jsxRuntime.jsx(ProfileLoginSection, {
3597
+ nodes: flow.ui.nodes,
3598
+ ProfileLoginSectionWrapper: ProfileLoginSectionWrapper
3599
+ }) : undefined;
3496
3600
  $flow = hasPassword(flow.ui.nodes) ? /*#__PURE__*/ jsxRuntime.jsx(LoginSection, {
3497
3601
  LoginSectionWrapper: LoginSectionWrapper,
3498
3602
  nodes: flow.ui.nodes
3499
3603
  }) : undefined;
3604
+ $code = hasCode(flow.ui.nodes) ? /*#__PURE__*/ jsxRuntime.jsx(AuthCodeSection, {
3605
+ AuthCodeSectionWrapper: AuthCodeSectionWrapper,
3606
+ nodes: flow.ui.nodes
3607
+ }) : undefined;
3500
3608
  break;
3501
3609
  case "registration":
3502
- $passwordless = hasWebauthn(flow.ui.nodes) ? /*#__PURE__*/ jsxRuntime.jsx(PasswordlessSection, {
3610
+ $passkey = hasPasskey(flow.ui.nodes) ? /*#__PURE__*/ jsxRuntime.jsx(PasswordlessSection, {
3503
3611
  flow: flow,
3504
3612
  PasswordlessSectionWrapper: PasswordlessSectionWrapper
3505
3613
  }) : undefined;
3614
+ $profile = hasProfile(flow.ui.nodes) ? /*#__PURE__*/ jsxRuntime.jsx(ProfileRegistrationSection, {
3615
+ nodes: flow.ui.nodes,
3616
+ ProfileRegistrationSectionWrapper: ProfileRegistrationSectionWrapper
3617
+ }) : undefined;
3506
3618
  $oidc = hasOidc(flow.ui.nodes) ? /*#__PURE__*/ jsxRuntime.jsx(OidcSection, {
3507
3619
  flow: flow,
3508
3620
  OidcSectionWrapper: OidcSectionWrapper
@@ -3511,7 +3623,7 @@ function _object_spread$5(target) {
3511
3623
  AuthCodeSectionWrapper: AuthCodeSectionWrapper,
3512
3624
  nodes: flow.ui.nodes
3513
3625
  }) : undefined;
3514
- $flow = hasPassword(flow.ui.nodes) ? /*#__PURE__*/ jsxRuntime.jsx(RegistrationSection, {
3626
+ $flow = hasDefault(flow.ui.nodes) || hasPassword(flow.ui.nodes) ? /*#__PURE__*/ jsxRuntime.jsx(RegistrationSection, {
3515
3627
  nodes: flow.ui.nodes,
3516
3628
  RegistrationSectionWrapper: RegistrationSectionWrapper
3517
3629
  }) : undefined;
@@ -3525,9 +3637,8 @@ function _object_spread$5(target) {
3525
3637
  });
3526
3638
  break;
3527
3639
  }
3528
- // passwordless can be shown if the user is not logged in (e.g. exclude 2FA screen) or if the flow is a registration flow.
3529
- // we want the login section to handle passwordless as well when we have a 2FA screen.
3530
- var canShowPasswordless = !!$passwordless && (!isLoggedIn(flow) || flowType === "registration");
3640
+ var canShowPasskey = !!$passkey && (!isLoggedIn(flow) || flowType === "registration");
3641
+ var canShowProfile = !!$profile && hasProfile(flow.ui.nodes);
3531
3642
  return /*#__PURE__*/ jsxRuntime.jsxs("div", {
3532
3643
  className: className,
3533
3644
  children: [
@@ -3538,6 +3649,16 @@ function _object_spread$5(target) {
3538
3649
  flow: flow,
3539
3650
  children: $oidc
3540
3651
  }),
3652
+ $twoStep && /*#__PURE__*/ jsxRuntime.jsx(UserAuthForm, {
3653
+ flow: flow,
3654
+ children: $twoStep
3655
+ }),
3656
+ canShowPasskey && /*#__PURE__*/ jsxRuntime.jsx(UserAuthForm, {
3657
+ submitOnEnter: true,
3658
+ flow: flow,
3659
+ onSubmit: onSubmit,
3660
+ children: $passkey
3661
+ }),
3541
3662
  $code && /*#__PURE__*/ jsxRuntime.jsx(UserAuthForm, {
3542
3663
  flow: flow,
3543
3664
  children: $code
@@ -3548,16 +3669,26 @@ function _object_spread$5(target) {
3548
3669
  onSubmit: onSubmit,
3549
3670
  children: $flow
3550
3671
  }),
3551
- twoFactorFlows,
3552
- canShowPasswordless && /*#__PURE__*/ jsxRuntime.jsx(UserAuthForm, {
3553
- submitOnEnter: true,
3672
+ isTwoFactor && /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
3673
+ children: [
3674
+ /*#__PURE__*/ jsxRuntime.jsx(NodeMessages, {
3675
+ nodes: filterNodesByGroups({
3676
+ nodes: flow.ui.nodes,
3677
+ groups: [
3678
+ client.UiNodeGroupEnum.Password,
3679
+ client.UiNodeGroupEnum.Webauthn,
3680
+ client.UiNodeGroupEnum.Passkey,
3681
+ client.UiNodeGroupEnum.Totp,
3682
+ client.UiNodeGroupEnum.LookupSecret
3683
+ ]
3684
+ })
3685
+ }),
3686
+ twoFactorFlows
3687
+ ]
3688
+ }),
3689
+ canShowProfile && /*#__PURE__*/ jsxRuntime.jsx(UserAuthForm, {
3554
3690
  flow: flow,
3555
- formFilterOverride: {
3556
- nodes: flow.ui.nodes,
3557
- attributes: "hidden"
3558
- },
3559
- onSubmit: onSubmit,
3560
- children: $passwordless
3691
+ children: $profile
3561
3692
  })
3562
3693
  ]
3563
3694
  });
@@ -3640,7 +3771,7 @@ function LookupSecretSettingsSection(param) {
3640
3771
  var flow = param.flow, LookupSecretSettingsSectionWrapper = param.LookupSecretSettingsSectionWrapper;
3641
3772
  var filter = {
3642
3773
  nodes: flow.ui.nodes,
3643
- groups: "lookup_secret",
3774
+ groups: client.UiNodeGroupEnum.LookupSecret,
3644
3775
  withoutDefaultGroup: true
3645
3776
  };
3646
3777
  if (!hasLookupSecret(flow.ui.nodes)) return null;
@@ -3667,7 +3798,7 @@ function OidcSettingsSection(param) {
3667
3798
  children: /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3668
3799
  filter: {
3669
3800
  nodes: flow.ui.nodes,
3670
- groups: "oidc",
3801
+ groups: client.UiNodeGroupEnum.Oidc,
3671
3802
  withoutDefaultGroup: true
3672
3803
  }
3673
3804
  })
@@ -3726,15 +3857,15 @@ function _object_spread_props$3(target, source) {
3726
3857
  }
3727
3858
  return target;
3728
3859
  }
3729
- function PasswordSettingsSection(param) {
3730
- var flow = param.flow, PasswordSettingsSectionWrapper = param.PasswordSettingsSectionWrapper;
3731
- if (!hasPassword(flow.ui.nodes)) return null;
3860
+ function PasskeySettingsSection(param) {
3861
+ var flow = param.flow, PasskeySettingsSectionWrapper = param.PasskeySettingsSectionWrapper;
3862
+ if (!hasPasskey(flow.ui.nodes)) return null;
3732
3863
  var filter = {
3733
3864
  nodes: flow.ui.nodes,
3734
- groups: "password",
3865
+ groups: client.UiNodeGroupEnum.Passkey,
3735
3866
  withoutDefaultGroup: true
3736
3867
  };
3737
- return /*#__PURE__*/ jsxRuntime.jsxs(PasswordSettingsSectionWrapper, {
3868
+ return /*#__PURE__*/ jsxRuntime.jsxs(PasskeySettingsSectionWrapper, {
3738
3869
  children: [
3739
3870
  /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3740
3871
  filter: _object_spread_props$3(_object_spread$3({}, filter), {
@@ -3802,13 +3933,15 @@ function _object_spread_props$2(target, source) {
3802
3933
  }
3803
3934
  return target;
3804
3935
  }
3805
- function ProfileSettingsSection(param) {
3806
- var flow = param.flow, ProfileSettingsSectionWrapper = param.ProfileSettingsSectionWrapper;
3936
+ function PasswordSettingsSection(param) {
3937
+ var flow = param.flow, PasswordSettingsSectionWrapper = param.PasswordSettingsSectionWrapper;
3938
+ if (!hasPassword(flow.ui.nodes)) return null;
3807
3939
  var filter = {
3808
3940
  nodes: flow.ui.nodes,
3809
- groups: "profile"
3941
+ groups: client.UiNodeGroupEnum.Password,
3942
+ withoutDefaultGroup: true
3810
3943
  };
3811
- return /*#__PURE__*/ jsxRuntime.jsxs(ProfileSettingsSectionWrapper, {
3944
+ return /*#__PURE__*/ jsxRuntime.jsxs(PasswordSettingsSectionWrapper, {
3812
3945
  children: [
3813
3946
  /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3814
3947
  filter: _object_spread_props$2(_object_spread$2({}, filter), {
@@ -3876,15 +4009,13 @@ function _object_spread_props$1(target, source) {
3876
4009
  }
3877
4010
  return target;
3878
4011
  }
3879
- function TotpSettingsSection(param) {
3880
- var flow = param.flow, TotpSettingsSectionWrapper = param.TotpSettingsSectionWrapper;
3881
- if (!hasTotp(flow.ui.nodes)) return null;
4012
+ function ProfileSettingsSection(param) {
4013
+ var flow = param.flow, ProfileSettingsSectionWrapper = param.ProfileSettingsSectionWrapper;
3882
4014
  var filter = {
3883
4015
  nodes: flow.ui.nodes,
3884
- groups: "totp",
3885
- withoutDefaultGroup: true
4016
+ groups: client.UiNodeGroupEnum.Profile
3886
4017
  };
3887
- return /*#__PURE__*/ jsxRuntime.jsxs(TotpSettingsSectionWrapper, {
4018
+ return /*#__PURE__*/ jsxRuntime.jsxs(ProfileSettingsSectionWrapper, {
3888
4019
  children: [
3889
4020
  /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3890
4021
  filter: _object_spread_props$1(_object_spread$1({}, filter), {
@@ -3952,15 +4083,15 @@ function _object_spread_props(target, source) {
3952
4083
  }
3953
4084
  return target;
3954
4085
  }
3955
- function WebAuthnSettingsSection(param) {
3956
- var flow = param.flow, WebAuthnSettingsSectionWrapper = param.WebAuthnSettingsSectionWrapper;
3957
- if (!hasWebauthn(flow.ui.nodes)) return null;
4086
+ function TotpSettingsSection(param) {
4087
+ var flow = param.flow, TotpSettingsSectionWrapper = param.TotpSettingsSectionWrapper;
4088
+ if (!hasTotp(flow.ui.nodes)) return null;
3958
4089
  var filter = {
3959
4090
  nodes: flow.ui.nodes,
3960
- groups: "webauthn",
4091
+ groups: client.UiNodeGroupEnum.Totp,
3961
4092
  withoutDefaultGroup: true
3962
4093
  };
3963
- return /*#__PURE__*/ jsxRuntime.jsxs(WebAuthnSettingsSectionWrapper, {
4094
+ return /*#__PURE__*/ jsxRuntime.jsxs(TotpSettingsSectionWrapper, {
3964
4095
  children: [
3965
4096
  /*#__PURE__*/ jsxRuntime.jsx(FilterFlowNodes, {
3966
4097
  filter: _object_spread_props(_object_spread({}, filter), {
@@ -3984,32 +4115,32 @@ function UserSettingsCard(param) {
3984
4115
  excludeScripts: excludeScripts
3985
4116
  });
3986
4117
  var $flow = function() {
3987
- if (flowType === "profile") {
4118
+ if (flowType === client.UiNodeGroupEnum.Profile) {
3988
4119
  return /*#__PURE__*/ jsxRuntime.jsx(ProfileSettingsSection, {
3989
4120
  flow: flow,
3990
4121
  ProfileSettingsSectionWrapper: ProfileSettingsSectionWrapper
3991
4122
  });
3992
- } else if (flowType === "password" && hasPassword(flow.ui.nodes)) {
4123
+ } else if (flowType === client.UiNodeGroupEnum.Password && hasPassword(flow.ui.nodes)) {
3993
4124
  return /*#__PURE__*/ jsxRuntime.jsx(PasswordSettingsSection, {
3994
4125
  flow: flow,
3995
4126
  PasswordSettingsSectionWrapper: PasswordSettingsSectionWrapper
3996
4127
  });
3997
- } else if (flowType === "webauthn" && hasWebauthn(flow.ui.nodes)) {
3998
- return /*#__PURE__*/ jsxRuntime.jsx(WebAuthnSettingsSection, {
4128
+ } else if (flowType === client.UiNodeGroupEnum.Passkey && hasPasskey(flow.ui.nodes)) {
4129
+ return /*#__PURE__*/ jsxRuntime.jsx(PasskeySettingsSection, {
3999
4130
  flow: flow,
4000
- WebAuthnSettingsSectionWrapper: WebAuthnSettingsSectionWrapper
4131
+ PasskeySettingsSectionWrapper: WebAuthnSettingsSectionWrapper
4001
4132
  });
4002
- } else if (flowType === "lookupSecret" && hasLookupSecret(flow.ui.nodes)) {
4133
+ } else if (flowType === client.UiNodeGroupEnum.LookupSecret && hasLookupSecret(flow.ui.nodes)) {
4003
4134
  return /*#__PURE__*/ jsxRuntime.jsx(LookupSecretSettingsSection, {
4004
4135
  flow: flow,
4005
4136
  LookupSecretSettingsSectionWrapper: LookupSecretSettingsSectionWrapper
4006
4137
  });
4007
- } else if (flowType === "oidc" && hasOidc(flow.ui.nodes)) {
4138
+ } else if (flowType === client.UiNodeGroupEnum.Oidc && hasOidc(flow.ui.nodes)) {
4008
4139
  return /*#__PURE__*/ jsxRuntime.jsx(OidcSettingsSection, {
4009
4140
  flow: flow,
4010
4141
  OidcSettingsSectionWrapper: OidcSettingsSectionWrapper
4011
4142
  });
4012
- } else if (flowType === "totp" && hasTotp(flow.ui.nodes)) {
4143
+ } else if (flowType === client.UiNodeGroupEnum.Totp && hasTotp(flow.ui.nodes)) {
4013
4144
  return /*#__PURE__*/ jsxRuntime.jsx(TotpSettingsSection, {
4014
4145
  flow: flow,
4015
4146
  TotpSettingsSectionWrapper: TotpSettingsSectionWrapper