@leancodepl/kratos 7.7.0 → 7.8.1
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 +243 -99
- package/index.esm.js +244 -100
- 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,19 +3283,27 @@ 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, {
|
|
3250
3293
|
children: [
|
|
3251
3294
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3252
3295
|
filter: _object_spread_props$6(_object_spread$7({}, filter), {
|
|
3253
|
-
|
|
3296
|
+
groups: [
|
|
3297
|
+
"identifier_first",
|
|
3298
|
+
"passkey"
|
|
3299
|
+
],
|
|
3300
|
+
attributes: [
|
|
3301
|
+
"hidden"
|
|
3302
|
+
]
|
|
3303
|
+
})
|
|
3304
|
+
}),
|
|
3305
|
+
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3306
|
+
filter: _object_spread_props$6(_object_spread$7({}, filter), {
|
|
3254
3307
|
excludeAttributes: [
|
|
3255
3308
|
"hidden",
|
|
3256
3309
|
"button",
|
|
@@ -3263,6 +3316,9 @@ function PasswordlessSection(param) {
|
|
|
3263
3316
|
attributes: [
|
|
3264
3317
|
"button",
|
|
3265
3318
|
"submit"
|
|
3319
|
+
],
|
|
3320
|
+
excludeAttributes: [
|
|
3321
|
+
"hidden"
|
|
3266
3322
|
]
|
|
3267
3323
|
})
|
|
3268
3324
|
})
|
|
@@ -3270,6 +3326,52 @@ function PasswordlessSection(param) {
|
|
|
3270
3326
|
});
|
|
3271
3327
|
}
|
|
3272
3328
|
|
|
3329
|
+
function ProfileLoginSection(param) {
|
|
3330
|
+
var nodes = param.nodes, ProfileLoginSectionWrapper = param.ProfileLoginSectionWrapper;
|
|
3331
|
+
return /*#__PURE__*/ jsxs(ProfileLoginSectionWrapper, {
|
|
3332
|
+
children: [
|
|
3333
|
+
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3334
|
+
filter: {
|
|
3335
|
+
nodes: nodes,
|
|
3336
|
+
groups: UiNodeGroupEnum.Profile,
|
|
3337
|
+
excludeAttributes: "submit,hidden"
|
|
3338
|
+
}
|
|
3339
|
+
}),
|
|
3340
|
+
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3341
|
+
filter: {
|
|
3342
|
+
nodes: nodes,
|
|
3343
|
+
groups: UiNodeGroupEnum.Profile,
|
|
3344
|
+
excludeAttributes: "hidden",
|
|
3345
|
+
attributes: "submit"
|
|
3346
|
+
}
|
|
3347
|
+
})
|
|
3348
|
+
]
|
|
3349
|
+
});
|
|
3350
|
+
}
|
|
3351
|
+
|
|
3352
|
+
function ProfileRegistrationSection(param) {
|
|
3353
|
+
var nodes = param.nodes, ProfileRegistrationSectionWrapper = param.ProfileRegistrationSectionWrapper;
|
|
3354
|
+
return /*#__PURE__*/ jsxs(ProfileRegistrationSectionWrapper, {
|
|
3355
|
+
children: [
|
|
3356
|
+
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3357
|
+
filter: {
|
|
3358
|
+
nodes: nodes,
|
|
3359
|
+
groups: UiNodeGroupEnum.Profile,
|
|
3360
|
+
excludeAttributes: "submit,hidden"
|
|
3361
|
+
}
|
|
3362
|
+
}),
|
|
3363
|
+
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3364
|
+
filter: {
|
|
3365
|
+
nodes: nodes,
|
|
3366
|
+
groups: UiNodeGroupEnum.Profile,
|
|
3367
|
+
excludeAttributes: "hidden",
|
|
3368
|
+
attributes: "submit"
|
|
3369
|
+
}
|
|
3370
|
+
})
|
|
3371
|
+
]
|
|
3372
|
+
});
|
|
3373
|
+
}
|
|
3374
|
+
|
|
3273
3375
|
function _define_property$6(obj, key, value) {
|
|
3274
3376
|
if (key in obj) {
|
|
3275
3377
|
Object.defineProperty(obj, key, {
|
|
@@ -3327,19 +3429,18 @@ function RegistrationSection(param) {
|
|
|
3327
3429
|
if (!hasPassword(nodes)) return null;
|
|
3328
3430
|
var filter = {
|
|
3329
3431
|
nodes: nodes,
|
|
3330
|
-
groups:
|
|
3331
|
-
"password"
|
|
3332
|
-
]
|
|
3432
|
+
groups: UiNodeGroupEnum.Password
|
|
3333
3433
|
};
|
|
3334
3434
|
return /*#__PURE__*/ jsxs(RegistrationSectionWrapper, {
|
|
3335
3435
|
children: [
|
|
3336
3436
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3337
3437
|
filter: _object_spread_props$5(_object_spread$6({}, filter), {
|
|
3338
|
-
excludeAttributes: "submit"
|
|
3438
|
+
excludeAttributes: "submit,hidden"
|
|
3339
3439
|
})
|
|
3340
3440
|
}),
|
|
3341
3441
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3342
3442
|
filter: _object_spread_props$5(_object_spread$6({}, filter), {
|
|
3443
|
+
excludeAttributes: "hidden",
|
|
3343
3444
|
attributes: "submit"
|
|
3344
3445
|
})
|
|
3345
3446
|
})
|
|
@@ -3400,7 +3501,7 @@ function _object_spread$5(target) {
|
|
|
3400
3501
|
* @returns JSX.Element
|
|
3401
3502
|
*/ function UserAuthCard(param) {
|
|
3402
3503
|
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;
|
|
3504
|
+
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
3505
|
useScriptNodes({
|
|
3405
3506
|
nodes: flow.ui.nodes,
|
|
3406
3507
|
excludeScripts: excludeScripts
|
|
@@ -3408,17 +3509,19 @@ function _object_spread$5(target) {
|
|
|
3408
3509
|
var $flow = undefined;
|
|
3409
3510
|
var $oidc = undefined;
|
|
3410
3511
|
var $code = undefined;
|
|
3411
|
-
var $
|
|
3512
|
+
var $passkey = undefined;
|
|
3513
|
+
var $twoStep = undefined;
|
|
3514
|
+
var $profile = undefined;
|
|
3412
3515
|
// 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) ||
|
|
3516
|
+
var isTwoFactor = flowType === "login" && isLoggedIn(flow) && (hasTotp(flow.ui.nodes) || hasPasskey(flow.ui.nodes) || hasLookupSecret(flow.ui.nodes));
|
|
3414
3517
|
// This array contains all the 2fa flows mapped to their own respective forms.
|
|
3415
3518
|
var twoFactorFlows = isTwoFactor && [
|
|
3416
|
-
|
|
3519
|
+
hasPasskey(flow.ui.nodes) && /*#__PURE__*/ jsx(UserAuthForm, {
|
|
3417
3520
|
flow: flow,
|
|
3418
3521
|
children: /*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3419
3522
|
filter: {
|
|
3420
3523
|
nodes: flow.ui.nodes,
|
|
3421
|
-
groups:
|
|
3524
|
+
groups: UiNodeGroupEnum.Passkey,
|
|
3422
3525
|
withoutDefaultGroup: true
|
|
3423
3526
|
}
|
|
3424
3527
|
})
|
|
@@ -3428,7 +3531,17 @@ function _object_spread$5(target) {
|
|
|
3428
3531
|
children: /*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3429
3532
|
filter: {
|
|
3430
3533
|
nodes: flow.ui.nodes,
|
|
3431
|
-
groups:
|
|
3534
|
+
groups: UiNodeGroupEnum.Password,
|
|
3535
|
+
withoutDefaultGroup: true
|
|
3536
|
+
}
|
|
3537
|
+
})
|
|
3538
|
+
}),
|
|
3539
|
+
hasProfile(flow.ui.nodes) && /*#__PURE__*/ jsx(UserAuthForm, {
|
|
3540
|
+
flow: flow,
|
|
3541
|
+
children: /*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3542
|
+
filter: {
|
|
3543
|
+
nodes: flow.ui.nodes,
|
|
3544
|
+
groups: UiNodeGroupEnum.Profile,
|
|
3432
3545
|
withoutDefaultGroup: true
|
|
3433
3546
|
}
|
|
3434
3547
|
})
|
|
@@ -3441,7 +3554,7 @@ function _object_spread$5(target) {
|
|
|
3441
3554
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3442
3555
|
filter: {
|
|
3443
3556
|
nodes: flow.ui.nodes,
|
|
3444
|
-
groups:
|
|
3557
|
+
groups: UiNodeGroupEnum.Totp,
|
|
3445
3558
|
withoutDefaultGroup: true,
|
|
3446
3559
|
excludeAttributes: "submit"
|
|
3447
3560
|
}
|
|
@@ -3449,7 +3562,7 @@ function _object_spread$5(target) {
|
|
|
3449
3562
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3450
3563
|
filter: {
|
|
3451
3564
|
nodes: flow.ui.nodes,
|
|
3452
|
-
groups:
|
|
3565
|
+
groups: UiNodeGroupEnum.Totp,
|
|
3453
3566
|
withoutDefaultGroup: true,
|
|
3454
3567
|
attributes: "submit"
|
|
3455
3568
|
}
|
|
@@ -3463,7 +3576,7 @@ function _object_spread$5(target) {
|
|
|
3463
3576
|
children: /*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3464
3577
|
filter: {
|
|
3465
3578
|
nodes: flow.ui.nodes,
|
|
3466
|
-
groups:
|
|
3579
|
+
groups: UiNodeGroupEnum.LookupSecret,
|
|
3467
3580
|
withoutDefaultGroup: true
|
|
3468
3581
|
}
|
|
3469
3582
|
})
|
|
@@ -3472,28 +3585,40 @@ function _object_spread$5(target) {
|
|
|
3472
3585
|
;
|
|
3473
3586
|
switch(flowType){
|
|
3474
3587
|
case "login":
|
|
3475
|
-
$passwordless = hasWebauthn(flow.ui.nodes) ? /*#__PURE__*/ jsx(PasswordlessSection, {
|
|
3476
|
-
flow: flow,
|
|
3477
|
-
PasswordlessSectionWrapper: PasswordlessSectionWrapper
|
|
3478
|
-
}) : undefined;
|
|
3479
3588
|
$oidc = hasOidc(flow.ui.nodes) ? /*#__PURE__*/ jsx(OidcSection, {
|
|
3480
3589
|
flow: flow,
|
|
3481
3590
|
OidcSectionWrapper: OidcSectionWrapper
|
|
3482
3591
|
}) : undefined;
|
|
3483
|
-
$
|
|
3484
|
-
|
|
3592
|
+
$passkey = hasPasskey(flow.ui.nodes) ? /*#__PURE__*/ jsx(PasswordlessSection, {
|
|
3593
|
+
flow: flow,
|
|
3594
|
+
PasswordlessSectionWrapper: PasswordlessSectionWrapper
|
|
3595
|
+
}) : undefined;
|
|
3596
|
+
$twoStep = hasIdentifierFirst(flow.ui.nodes) ? /*#__PURE__*/ jsx(IdentifierFirstLoginSection, {
|
|
3597
|
+
IdentifierFirstLoginSectionWrapper: IdentifierFirstLoginSectionWrapper,
|
|
3485
3598
|
nodes: flow.ui.nodes
|
|
3486
3599
|
}) : undefined;
|
|
3600
|
+
$profile = hasProfile(flow.ui.nodes) ? /*#__PURE__*/ jsx(ProfileLoginSection, {
|
|
3601
|
+
nodes: flow.ui.nodes,
|
|
3602
|
+
ProfileLoginSectionWrapper: ProfileLoginSectionWrapper
|
|
3603
|
+
}) : undefined;
|
|
3487
3604
|
$flow = hasPassword(flow.ui.nodes) ? /*#__PURE__*/ jsx(LoginSection, {
|
|
3488
3605
|
LoginSectionWrapper: LoginSectionWrapper,
|
|
3489
3606
|
nodes: flow.ui.nodes
|
|
3490
3607
|
}) : undefined;
|
|
3608
|
+
$code = hasCode(flow.ui.nodes) ? /*#__PURE__*/ jsx(AuthCodeSection, {
|
|
3609
|
+
AuthCodeSectionWrapper: AuthCodeSectionWrapper,
|
|
3610
|
+
nodes: flow.ui.nodes
|
|
3611
|
+
}) : undefined;
|
|
3491
3612
|
break;
|
|
3492
3613
|
case "registration":
|
|
3493
|
-
$
|
|
3614
|
+
$passkey = hasPasskey(flow.ui.nodes) ? /*#__PURE__*/ jsx(PasswordlessSection, {
|
|
3494
3615
|
flow: flow,
|
|
3495
3616
|
PasswordlessSectionWrapper: PasswordlessSectionWrapper
|
|
3496
3617
|
}) : undefined;
|
|
3618
|
+
$profile = hasProfile(flow.ui.nodes) ? /*#__PURE__*/ jsx(ProfileRegistrationSection, {
|
|
3619
|
+
nodes: flow.ui.nodes,
|
|
3620
|
+
ProfileRegistrationSectionWrapper: ProfileRegistrationSectionWrapper
|
|
3621
|
+
}) : undefined;
|
|
3497
3622
|
$oidc = hasOidc(flow.ui.nodes) ? /*#__PURE__*/ jsx(OidcSection, {
|
|
3498
3623
|
flow: flow,
|
|
3499
3624
|
OidcSectionWrapper: OidcSectionWrapper
|
|
@@ -3502,7 +3627,7 @@ function _object_spread$5(target) {
|
|
|
3502
3627
|
AuthCodeSectionWrapper: AuthCodeSectionWrapper,
|
|
3503
3628
|
nodes: flow.ui.nodes
|
|
3504
3629
|
}) : undefined;
|
|
3505
|
-
$flow = hasPassword(flow.ui.nodes) ? /*#__PURE__*/ jsx(RegistrationSection, {
|
|
3630
|
+
$flow = hasDefault(flow.ui.nodes) || hasPassword(flow.ui.nodes) ? /*#__PURE__*/ jsx(RegistrationSection, {
|
|
3506
3631
|
nodes: flow.ui.nodes,
|
|
3507
3632
|
RegistrationSectionWrapper: RegistrationSectionWrapper
|
|
3508
3633
|
}) : undefined;
|
|
@@ -3516,9 +3641,8 @@ function _object_spread$5(target) {
|
|
|
3516
3641
|
});
|
|
3517
3642
|
break;
|
|
3518
3643
|
}
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
var canShowPasswordless = !!$passwordless && (!isLoggedIn(flow) || flowType === "registration");
|
|
3644
|
+
var canShowPasskey = !!$passkey && (!isLoggedIn(flow) || flowType === "registration");
|
|
3645
|
+
var canShowProfile = !!$profile && hasProfile(flow.ui.nodes);
|
|
3522
3646
|
return /*#__PURE__*/ jsxs("div", {
|
|
3523
3647
|
className: className,
|
|
3524
3648
|
children: [
|
|
@@ -3529,6 +3653,16 @@ function _object_spread$5(target) {
|
|
|
3529
3653
|
flow: flow,
|
|
3530
3654
|
children: $oidc
|
|
3531
3655
|
}),
|
|
3656
|
+
$twoStep && /*#__PURE__*/ jsx(UserAuthForm, {
|
|
3657
|
+
flow: flow,
|
|
3658
|
+
children: $twoStep
|
|
3659
|
+
}),
|
|
3660
|
+
canShowPasskey && /*#__PURE__*/ jsx(UserAuthForm, {
|
|
3661
|
+
submitOnEnter: true,
|
|
3662
|
+
flow: flow,
|
|
3663
|
+
onSubmit: onSubmit,
|
|
3664
|
+
children: $passkey
|
|
3665
|
+
}),
|
|
3532
3666
|
$code && /*#__PURE__*/ jsx(UserAuthForm, {
|
|
3533
3667
|
flow: flow,
|
|
3534
3668
|
children: $code
|
|
@@ -3539,16 +3673,26 @@ function _object_spread$5(target) {
|
|
|
3539
3673
|
onSubmit: onSubmit,
|
|
3540
3674
|
children: $flow
|
|
3541
3675
|
}),
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3676
|
+
isTwoFactor && /*#__PURE__*/ jsxs(Fragment, {
|
|
3677
|
+
children: [
|
|
3678
|
+
/*#__PURE__*/ jsx(NodeMessages, {
|
|
3679
|
+
nodes: filterNodesByGroups({
|
|
3680
|
+
nodes: flow.ui.nodes,
|
|
3681
|
+
groups: [
|
|
3682
|
+
UiNodeGroupEnum.Password,
|
|
3683
|
+
UiNodeGroupEnum.Webauthn,
|
|
3684
|
+
UiNodeGroupEnum.Passkey,
|
|
3685
|
+
UiNodeGroupEnum.Totp,
|
|
3686
|
+
UiNodeGroupEnum.LookupSecret
|
|
3687
|
+
]
|
|
3688
|
+
})
|
|
3689
|
+
}),
|
|
3690
|
+
twoFactorFlows
|
|
3691
|
+
]
|
|
3692
|
+
}),
|
|
3693
|
+
canShowProfile && /*#__PURE__*/ jsx(UserAuthForm, {
|
|
3545
3694
|
flow: flow,
|
|
3546
|
-
|
|
3547
|
-
nodes: flow.ui.nodes,
|
|
3548
|
-
attributes: "hidden"
|
|
3549
|
-
},
|
|
3550
|
-
onSubmit: onSubmit,
|
|
3551
|
-
children: $passwordless
|
|
3695
|
+
children: $profile
|
|
3552
3696
|
})
|
|
3553
3697
|
]
|
|
3554
3698
|
});
|
|
@@ -3631,7 +3775,7 @@ function LookupSecretSettingsSection(param) {
|
|
|
3631
3775
|
var flow = param.flow, LookupSecretSettingsSectionWrapper = param.LookupSecretSettingsSectionWrapper;
|
|
3632
3776
|
var filter = {
|
|
3633
3777
|
nodes: flow.ui.nodes,
|
|
3634
|
-
groups:
|
|
3778
|
+
groups: UiNodeGroupEnum.LookupSecret,
|
|
3635
3779
|
withoutDefaultGroup: true
|
|
3636
3780
|
};
|
|
3637
3781
|
if (!hasLookupSecret(flow.ui.nodes)) return null;
|
|
@@ -3658,7 +3802,7 @@ function OidcSettingsSection(param) {
|
|
|
3658
3802
|
children: /*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3659
3803
|
filter: {
|
|
3660
3804
|
nodes: flow.ui.nodes,
|
|
3661
|
-
groups:
|
|
3805
|
+
groups: UiNodeGroupEnum.Oidc,
|
|
3662
3806
|
withoutDefaultGroup: true
|
|
3663
3807
|
}
|
|
3664
3808
|
})
|
|
@@ -3717,15 +3861,15 @@ function _object_spread_props$3(target, source) {
|
|
|
3717
3861
|
}
|
|
3718
3862
|
return target;
|
|
3719
3863
|
}
|
|
3720
|
-
function
|
|
3721
|
-
var flow = param.flow,
|
|
3722
|
-
if (!
|
|
3864
|
+
function PasskeySettingsSection(param) {
|
|
3865
|
+
var flow = param.flow, PasskeySettingsSectionWrapper = param.PasskeySettingsSectionWrapper;
|
|
3866
|
+
if (!hasPasskey(flow.ui.nodes)) return null;
|
|
3723
3867
|
var filter = {
|
|
3724
3868
|
nodes: flow.ui.nodes,
|
|
3725
|
-
groups:
|
|
3869
|
+
groups: UiNodeGroupEnum.Passkey,
|
|
3726
3870
|
withoutDefaultGroup: true
|
|
3727
3871
|
};
|
|
3728
|
-
return /*#__PURE__*/ jsxs(
|
|
3872
|
+
return /*#__PURE__*/ jsxs(PasskeySettingsSectionWrapper, {
|
|
3729
3873
|
children: [
|
|
3730
3874
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3731
3875
|
filter: _object_spread_props$3(_object_spread$3({}, filter), {
|
|
@@ -3793,13 +3937,15 @@ function _object_spread_props$2(target, source) {
|
|
|
3793
3937
|
}
|
|
3794
3938
|
return target;
|
|
3795
3939
|
}
|
|
3796
|
-
function
|
|
3797
|
-
var flow = param.flow,
|
|
3940
|
+
function PasswordSettingsSection(param) {
|
|
3941
|
+
var flow = param.flow, PasswordSettingsSectionWrapper = param.PasswordSettingsSectionWrapper;
|
|
3942
|
+
if (!hasPassword(flow.ui.nodes)) return null;
|
|
3798
3943
|
var filter = {
|
|
3799
3944
|
nodes: flow.ui.nodes,
|
|
3800
|
-
groups:
|
|
3945
|
+
groups: UiNodeGroupEnum.Password,
|
|
3946
|
+
withoutDefaultGroup: true
|
|
3801
3947
|
};
|
|
3802
|
-
return /*#__PURE__*/ jsxs(
|
|
3948
|
+
return /*#__PURE__*/ jsxs(PasswordSettingsSectionWrapper, {
|
|
3803
3949
|
children: [
|
|
3804
3950
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3805
3951
|
filter: _object_spread_props$2(_object_spread$2({}, filter), {
|
|
@@ -3867,15 +4013,13 @@ function _object_spread_props$1(target, source) {
|
|
|
3867
4013
|
}
|
|
3868
4014
|
return target;
|
|
3869
4015
|
}
|
|
3870
|
-
function
|
|
3871
|
-
var flow = param.flow,
|
|
3872
|
-
if (!hasTotp(flow.ui.nodes)) return null;
|
|
4016
|
+
function ProfileSettingsSection(param) {
|
|
4017
|
+
var flow = param.flow, ProfileSettingsSectionWrapper = param.ProfileSettingsSectionWrapper;
|
|
3873
4018
|
var filter = {
|
|
3874
4019
|
nodes: flow.ui.nodes,
|
|
3875
|
-
groups:
|
|
3876
|
-
withoutDefaultGroup: true
|
|
4020
|
+
groups: UiNodeGroupEnum.Profile
|
|
3877
4021
|
};
|
|
3878
|
-
return /*#__PURE__*/ jsxs(
|
|
4022
|
+
return /*#__PURE__*/ jsxs(ProfileSettingsSectionWrapper, {
|
|
3879
4023
|
children: [
|
|
3880
4024
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3881
4025
|
filter: _object_spread_props$1(_object_spread$1({}, filter), {
|
|
@@ -3943,15 +4087,15 @@ function _object_spread_props(target, source) {
|
|
|
3943
4087
|
}
|
|
3944
4088
|
return target;
|
|
3945
4089
|
}
|
|
3946
|
-
function
|
|
3947
|
-
var flow = param.flow,
|
|
3948
|
-
if (!
|
|
4090
|
+
function TotpSettingsSection(param) {
|
|
4091
|
+
var flow = param.flow, TotpSettingsSectionWrapper = param.TotpSettingsSectionWrapper;
|
|
4092
|
+
if (!hasTotp(flow.ui.nodes)) return null;
|
|
3949
4093
|
var filter = {
|
|
3950
4094
|
nodes: flow.ui.nodes,
|
|
3951
|
-
groups:
|
|
4095
|
+
groups: UiNodeGroupEnum.Totp,
|
|
3952
4096
|
withoutDefaultGroup: true
|
|
3953
4097
|
};
|
|
3954
|
-
return /*#__PURE__*/ jsxs(
|
|
4098
|
+
return /*#__PURE__*/ jsxs(TotpSettingsSectionWrapper, {
|
|
3955
4099
|
children: [
|
|
3956
4100
|
/*#__PURE__*/ jsx(FilterFlowNodes, {
|
|
3957
4101
|
filter: _object_spread_props(_object_spread({}, filter), {
|
|
@@ -3975,32 +4119,32 @@ function UserSettingsCard(param) {
|
|
|
3975
4119
|
excludeScripts: excludeScripts
|
|
3976
4120
|
});
|
|
3977
4121
|
var $flow = function() {
|
|
3978
|
-
if (flowType ===
|
|
4122
|
+
if (flowType === UiNodeGroupEnum.Profile) {
|
|
3979
4123
|
return /*#__PURE__*/ jsx(ProfileSettingsSection, {
|
|
3980
4124
|
flow: flow,
|
|
3981
4125
|
ProfileSettingsSectionWrapper: ProfileSettingsSectionWrapper
|
|
3982
4126
|
});
|
|
3983
|
-
} else if (flowType ===
|
|
4127
|
+
} else if (flowType === UiNodeGroupEnum.Password && hasPassword(flow.ui.nodes)) {
|
|
3984
4128
|
return /*#__PURE__*/ jsx(PasswordSettingsSection, {
|
|
3985
4129
|
flow: flow,
|
|
3986
4130
|
PasswordSettingsSectionWrapper: PasswordSettingsSectionWrapper
|
|
3987
4131
|
});
|
|
3988
|
-
} else if (flowType ===
|
|
3989
|
-
return /*#__PURE__*/ jsx(
|
|
4132
|
+
} else if (flowType === UiNodeGroupEnum.Passkey && hasPasskey(flow.ui.nodes)) {
|
|
4133
|
+
return /*#__PURE__*/ jsx(PasskeySettingsSection, {
|
|
3990
4134
|
flow: flow,
|
|
3991
|
-
|
|
4135
|
+
PasskeySettingsSectionWrapper: WebAuthnSettingsSectionWrapper
|
|
3992
4136
|
});
|
|
3993
|
-
} else if (flowType ===
|
|
4137
|
+
} else if (flowType === UiNodeGroupEnum.LookupSecret && hasLookupSecret(flow.ui.nodes)) {
|
|
3994
4138
|
return /*#__PURE__*/ jsx(LookupSecretSettingsSection, {
|
|
3995
4139
|
flow: flow,
|
|
3996
4140
|
LookupSecretSettingsSectionWrapper: LookupSecretSettingsSectionWrapper
|
|
3997
4141
|
});
|
|
3998
|
-
} else if (flowType ===
|
|
4142
|
+
} else if (flowType === UiNodeGroupEnum.Oidc && hasOidc(flow.ui.nodes)) {
|
|
3999
4143
|
return /*#__PURE__*/ jsx(OidcSettingsSection, {
|
|
4000
4144
|
flow: flow,
|
|
4001
4145
|
OidcSettingsSectionWrapper: OidcSettingsSectionWrapper
|
|
4002
4146
|
});
|
|
4003
|
-
} else if (flowType ===
|
|
4147
|
+
} else if (flowType === UiNodeGroupEnum.Totp && hasTotp(flow.ui.nodes)) {
|
|
4004
4148
|
return /*#__PURE__*/ jsx(TotpSettingsSection, {
|
|
4005
4149
|
flow: flow,
|
|
4006
4150
|
TotpSettingsSectionWrapper: TotpSettingsSectionWrapper
|