@thunderid/vue 1.0.7 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/updateMeCredentials.d.ts +8 -0
- package/dist/api/updateMeCredentials.d.ts.map +1 -0
- package/dist/cjs/index.cjs +653 -71
- package/dist/components/auth/sign-in/AuthOptionFactoryCore.d.ts.map +1 -1
- package/dist/components/auth/sign-up/BaseSignUp.d.ts.map +1 -1
- package/dist/components/presentation/change-credential/BaseChangeCredential.d.ts +22 -0
- package/dist/components/presentation/change-credential/BaseChangeCredential.d.ts.map +1 -0
- package/dist/components/presentation/change-credential/ChangeCredential.css.d.ts +7 -0
- package/dist/components/presentation/change-credential/ChangeCredential.css.d.ts.map +1 -0
- package/dist/components/presentation/change-credential/ChangeCredential.d.ts +12 -0
- package/dist/components/presentation/change-credential/ChangeCredential.d.ts.map +1 -0
- package/dist/components/presentation/user-dropdown/BaseUserDropdown.d.ts +3 -0
- package/dist/components/presentation/user-dropdown/BaseUserDropdown.d.ts.map +1 -1
- package/dist/components/presentation/user-dropdown/UserDropdown.css.d.ts +2 -1
- package/dist/components/presentation/user-dropdown/UserDropdown.css.d.ts.map +1 -1
- package/dist/components/presentation/user-dropdown/UserDropdown.d.ts.map +1 -1
- package/dist/components/presentation/user-profile/UserProfile.css.d.ts +1 -1
- package/dist/components/presentation/user-profile/UserProfile.css.d.ts.map +1 -1
- package/dist/components/primitives/KeyValueList/KeyValueList.css.d.ts +12 -0
- package/dist/components/primitives/KeyValueList/KeyValueList.css.d.ts.map +1 -0
- package/dist/components/primitives/KeyValueList/KeyValueList.d.ts +7 -0
- package/dist/components/primitives/KeyValueList/KeyValueList.d.ts.map +1 -0
- package/dist/components/primitives/KeyValueList/index.d.ts +2 -0
- package/dist/components/primitives/KeyValueList/index.d.ts.map +1 -0
- package/dist/components/primitives/PasswordField/PasswordField.d.ts.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +647 -74
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConsentConstants, DEFAULT_THEME, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowComponentType as EmbeddedFlowComponentType$1, EmbeddedFlowEventType, EmbeddedFlowEventType as EmbeddedFlowEventType$1, EmbeddedFlowResponseType, EmbeddedFlowTextVariant, EmbeddedFlowType, EmbeddedSignInFlowStatus, EmbeddedSignInFlowStatus as EmbeddedSignInFlowStatus$1, EmbeddedSignInFlowType, EmbeddedSignInFlowType as EmbeddedSignInFlowType$1, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowStatus as EmbeddedSignUpFlowStatus$1, EmbeddedSignUpFlowType, FetchHttpClient, FieldType, FieldType as FieldType$1, FlowMetaType, ThunderIDAPIError, ThunderIDBrowserClient, ThunderIDError, ThunderIDRuntimeError, ThunderIDRuntimeError as ThunderIDRuntimeError$1, TranslationBundleConstants, arrayBufferToBase64url, base64urlToArrayBuffer, createClassObserver, createClassObserver as createClassObserver$1, createMediaQueryListener, createMediaQueryListener as createMediaQueryListener$1, createPackageComponentLogger, createPackageLogger, createTheme, deepMerge, detectThemeMode, detectThemeMode as detectThemeMode$1, executeEmbeddedSignInFlow, executeEmbeddedSignUpFlow, extractEmojiFromUri, extractUserClaimsFromIdToken, generateFlattenedUserProfile, get, getActiveTheme, getDefaultI18nBundles, getFlowMeta, getUsersMe, getUsersMeMeta, getVendorPrefix, handleWebAuthnAuthentication, hasAuthParamsInUrl, hasAuthParamsInUrl as hasAuthParamsInUrl$1, hasCalledForThisInstanceInUrl, hasUnresolvedTranslationParams, http, isEmojiUri, isEmpty, navigate, navigate as navigate$1, normalizeBorderRadius, normalizeTranslations, resolveFlowTemplateLiterals, resolveLogoUri, resolveResourceEndpoint, startCase, substituteTranslationParams, updateMeProfile, withVendorCSSClassPrefix } from "@thunderid/browser";
|
|
2
|
-
import { Fragment, Teleport, computed, defineComponent, h, inject, nextTick, onBeforeUnmount, onMounted, onUnmounted, provide, readonly, ref, shallowReadonly, shallowRef, watch } from "vue";
|
|
1
|
+
import { ConsentConstants, CredentialConstants, DEFAULT_THEME, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowComponentType as EmbeddedFlowComponentType$1, EmbeddedFlowEventType, EmbeddedFlowEventType as EmbeddedFlowEventType$1, EmbeddedFlowResponseType, EmbeddedFlowTextVariant, EmbeddedFlowType, EmbeddedSignInFlowStatus, EmbeddedSignInFlowStatus as EmbeddedSignInFlowStatus$1, EmbeddedSignInFlowType, EmbeddedSignInFlowType as EmbeddedSignInFlowType$1, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowStatus as EmbeddedSignUpFlowStatus$1, EmbeddedSignUpFlowType, FetchHttpClient, FieldType, FieldType as FieldType$1, FlowMetaType, ThunderIDAPIError, ThunderIDBrowserClient, ThunderIDError, ThunderIDRuntimeError, ThunderIDRuntimeError as ThunderIDRuntimeError$1, TranslationBundleConstants, arrayBufferToBase64url, base64urlToArrayBuffer, createClassObserver, createClassObserver as createClassObserver$1, createHttpClientFetcher, createMediaQueryListener, createMediaQueryListener as createMediaQueryListener$1, createPackageComponentLogger, createPackageLogger, createTheme, deepMerge, detectThemeMode, detectThemeMode as detectThemeMode$1, evaluateChangePasswordForm, executeEmbeddedSignInFlow, executeEmbeddedSignUpFlow, extractEmojiFromUri, extractUserClaimsFromIdToken, generateFlattenedUserProfile, get, getActiveTheme, getDefaultI18nBundles, getFlowMeta, getUsersMe, getUsersMeMeta, getVendorPrefix, handleWebAuthnAuthentication, hasAuthParamsInUrl, hasAuthParamsInUrl as hasAuthParamsInUrl$1, hasCalledForThisInstanceInUrl, hasUnresolvedTranslationParams, http, isEmojiUri, isEmpty, mapCredentialUpdateError, navigate, navigate as navigate$1, normalizeBorderRadius, normalizeTranslations, parseKeyValuePairs, parseKeyValuePairs as parseKeyValuePairs$1, resolveChangeCredentialPolicy, resolveFlowTemplateLiterals, resolveLogoUri, resolveResourceEndpoint, startCase, substituteTranslationParams, supportsCredential, updateMeCredentials, updateMeProfile, withVendorCSSClassPrefix } from "@thunderid/browser";
|
|
2
|
+
import { Fragment, Teleport, computed, defineComponent, h, inject, nextTick, onBeforeUnmount, onMounted, onUnmounted, provide, readonly, ref, shallowReadonly, shallowRef, useId, watch } from "vue";
|
|
3
3
|
import DOMPurify from "dompurify";
|
|
4
4
|
|
|
5
5
|
//#region src/keys.ts
|
|
@@ -1420,6 +1420,161 @@ const DEFAULTS_CSS = `
|
|
|
1420
1420
|
`;
|
|
1421
1421
|
var defaults_css_default = DEFAULTS_CSS;
|
|
1422
1422
|
|
|
1423
|
+
//#endregion
|
|
1424
|
+
//#region src/components/auth/sign-in/BaseSignIn.css.ts
|
|
1425
|
+
/**
|
|
1426
|
+
* Layout styles for the BaseSignIn composition.
|
|
1427
|
+
*
|
|
1428
|
+
* BEM block: `.thunderid-signin`
|
|
1429
|
+
*
|
|
1430
|
+
* Mirrors the layout constants in the React SDK's `BaseSignIn.styles.ts`
|
|
1431
|
+
* (min-width, content gap, logo sizing) so the sign-in card renders with the
|
|
1432
|
+
* same proportions across frameworks.
|
|
1433
|
+
*/
|
|
1434
|
+
const BASE_SIGN_IN_CSS = `
|
|
1435
|
+
/* ============================================================
|
|
1436
|
+
BaseSignIn
|
|
1437
|
+
============================================================ */
|
|
1438
|
+
|
|
1439
|
+
.thunderid-signin {
|
|
1440
|
+
min-width: 420px;
|
|
1441
|
+
margin: 0 auto;
|
|
1442
|
+
font-family: var(--thunderid-typography-fontFamily, inherit);
|
|
1443
|
+
border-radius: var(--thunderid-border-radius-large);
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
.thunderid-signin__content {
|
|
1447
|
+
display: flex;
|
|
1448
|
+
flex-direction: column;
|
|
1449
|
+
gap: calc(var(--thunderid-spacing-unit) * 2);
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
.thunderid-signin__content > img,
|
|
1453
|
+
.thunderid-signin__content > span[role='img'] {
|
|
1454
|
+
/* Flex column's default 'stretch' would otherwise force width: auto to fill
|
|
1455
|
+
the container instead of shrinking to the image's intrinsic size. */
|
|
1456
|
+
align-self: center;
|
|
1457
|
+
display: block;
|
|
1458
|
+
margin: 0 0 calc(var(--thunderid-spacing-unit) * 1) 0;
|
|
1459
|
+
border-radius: var(--thunderid-border-radius-small);
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
.thunderid-signin__messages {
|
|
1463
|
+
margin-top: calc(var(--thunderid-spacing-unit) * 2);
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
.thunderid-signin__messages > * + * {
|
|
1467
|
+
margin-top: calc(var(--thunderid-spacing-unit) * 1);
|
|
1468
|
+
}
|
|
1469
|
+
`;
|
|
1470
|
+
var BaseSignIn_css_default = BASE_SIGN_IN_CSS;
|
|
1471
|
+
|
|
1472
|
+
//#endregion
|
|
1473
|
+
//#region src/components/presentation/change-credential/ChangeCredential.css.ts
|
|
1474
|
+
/**
|
|
1475
|
+
* Styles for the ChangeCredential presentation component.
|
|
1476
|
+
* Parity target: `@thunderid/react` BaseChangeCredential.styles.ts
|
|
1477
|
+
*/
|
|
1478
|
+
const CHANGE_CREDENTIAL_CSS = `
|
|
1479
|
+
/* ============================================================
|
|
1480
|
+
ChangeCredential (React Parity)
|
|
1481
|
+
============================================================ */
|
|
1482
|
+
|
|
1483
|
+
.thunderid-change-credential {
|
|
1484
|
+
display: flex;
|
|
1485
|
+
flex-direction: column;
|
|
1486
|
+
gap: calc(var(--thunderid-spacing-unit) * 2);
|
|
1487
|
+
width: 100%;
|
|
1488
|
+
box-sizing: border-box;
|
|
1489
|
+
font-family: var(--thunderid-typography-fontFamily);
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
.thunderid-change-credential--card {
|
|
1493
|
+
padding: calc(var(--thunderid-spacing-unit) * 3);
|
|
1494
|
+
border: 1px solid var(--thunderid-color-border);
|
|
1495
|
+
border-radius: var(--thunderid-border-radius-large, 8px);
|
|
1496
|
+
background: var(--thunderid-color-background-surface);
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
.thunderid-change-credential__heading {
|
|
1500
|
+
margin: 0;
|
|
1501
|
+
font-size: 1.125rem;
|
|
1502
|
+
font-weight: 600;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
.thunderid-change-credential__fields {
|
|
1506
|
+
display: flex;
|
|
1507
|
+
flex-direction: column;
|
|
1508
|
+
gap: calc(var(--thunderid-spacing-unit) * 2);
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
.thunderid-change-credential__requirements-heading {
|
|
1512
|
+
margin: 0 0 calc(var(--thunderid-spacing-unit) / 2) 0;
|
|
1513
|
+
font-size: 0.8125rem;
|
|
1514
|
+
opacity: 0.8;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
.thunderid-change-credential__requirements {
|
|
1518
|
+
display: flex;
|
|
1519
|
+
flex-direction: column;
|
|
1520
|
+
gap: calc(var(--thunderid-spacing-unit) / 2);
|
|
1521
|
+
margin: 0;
|
|
1522
|
+
padding: 0;
|
|
1523
|
+
list-style: none;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
.thunderid-change-credential__requirement {
|
|
1527
|
+
display: flex;
|
|
1528
|
+
align-items: center;
|
|
1529
|
+
gap: var(--thunderid-spacing-unit);
|
|
1530
|
+
font-size: 0.8125rem;
|
|
1531
|
+
opacity: 0.7;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
.thunderid-change-credential__requirement--passed {
|
|
1535
|
+
color: var(--thunderid-color-success-main);
|
|
1536
|
+
opacity: 1;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
.thunderid-change-credential__requirement-icon {
|
|
1540
|
+
display: inline-flex;
|
|
1541
|
+
flex-shrink: 0;
|
|
1542
|
+
width: 14px;
|
|
1543
|
+
height: 14px;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
.thunderid-change-credential__actions {
|
|
1547
|
+
display: flex;
|
|
1548
|
+
align-items: center;
|
|
1549
|
+
justify-content: flex-end;
|
|
1550
|
+
gap: var(--thunderid-spacing-unit);
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
.thunderid-change-credential__unavailable {
|
|
1554
|
+
position: relative;
|
|
1555
|
+
display: flex;
|
|
1556
|
+
width: 100%;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
.thunderid-change-credential__unavailable-content {
|
|
1560
|
+
width: 100%;
|
|
1561
|
+
filter: blur(3px);
|
|
1562
|
+
opacity: 0.55;
|
|
1563
|
+
pointer-events: none;
|
|
1564
|
+
user-select: none;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
.thunderid-change-credential__unavailable-overlay {
|
|
1568
|
+
position: absolute;
|
|
1569
|
+
inset: 0;
|
|
1570
|
+
display: flex;
|
|
1571
|
+
align-items: center;
|
|
1572
|
+
justify-content: center;
|
|
1573
|
+
padding: calc(var(--thunderid-spacing-unit) * 2);
|
|
1574
|
+
}
|
|
1575
|
+
`;
|
|
1576
|
+
var ChangeCredential_css_default = CHANGE_CREDENTIAL_CSS;
|
|
1577
|
+
|
|
1423
1578
|
//#endregion
|
|
1424
1579
|
//#region src/components/presentation/language-switcher/LanguageSwitcher.css.ts
|
|
1425
1580
|
/**
|
|
@@ -1556,6 +1711,7 @@ var LanguageSwitcher_css_default = LANGUAGE_SWITCHER_CSS;
|
|
|
1556
1711
|
* __item--danger – destructive action (red text/hover)
|
|
1557
1712
|
*
|
|
1558
1713
|
* Elements:
|
|
1714
|
+
* __trigger-label – display name beside the trigger avatar (showTriggerLabel)
|
|
1559
1715
|
* __chevron – rotates 180° when menu is open
|
|
1560
1716
|
* __menu-header – user identity section at top of menu
|
|
1561
1717
|
* __menu-header-avatar – gradient avatar circle in header
|
|
@@ -1603,6 +1759,17 @@ const USER_DROPDOWN_CSS = `
|
|
|
1603
1759
|
box-shadow: 0 0 0 3px var(--thunderid-focus-ring-color);
|
|
1604
1760
|
}
|
|
1605
1761
|
|
|
1762
|
+
.thunderid-user-dropdown__trigger-label {
|
|
1763
|
+
color: var(--thunderid-color-text-primary);
|
|
1764
|
+
font-size: 0.875rem;
|
|
1765
|
+
font-weight: 500;
|
|
1766
|
+
max-width: 150px;
|
|
1767
|
+
overflow: hidden;
|
|
1768
|
+
text-overflow: ellipsis;
|
|
1769
|
+
white-space: nowrap;
|
|
1770
|
+
padding-right: calc(var(--thunderid-spacing-unit) * 0.5);
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1606
1773
|
.thunderid-user-dropdown__trigger:focus-visible {
|
|
1607
1774
|
border-color: var(--thunderid-color-primary-main);
|
|
1608
1775
|
box-shadow: 0 0 0 var(--thunderid-focus-ring-width) var(--thunderid-focus-ring-color);
|
|
@@ -1946,9 +2113,7 @@ const USER_PROFILE_CSS = `
|
|
|
1946
2113
|
display: flex;
|
|
1947
2114
|
flex-direction: column;
|
|
1948
2115
|
padding: calc(var(--thunderid-spacing-unit) * 4);
|
|
1949
|
-
width:
|
|
1950
|
-
max-width: 600px;
|
|
1951
|
-
margin: 0 auto;
|
|
2116
|
+
min-width: 600px;
|
|
1952
2117
|
font-family: var(--thunderid-typography-fontFamily);
|
|
1953
2118
|
background: var(--thunderid-color-background-surface);
|
|
1954
2119
|
border-radius: var(--thunderid-border-radius-large, 8px);
|
|
@@ -2085,6 +2250,7 @@ img.thunderid-user-profile__avatar {
|
|
|
2085
2250
|
display: flex;
|
|
2086
2251
|
align-items: center;
|
|
2087
2252
|
gap: var(--thunderid-spacing-unit);
|
|
2253
|
+
min-width: 0;
|
|
2088
2254
|
}
|
|
2089
2255
|
|
|
2090
2256
|
.thunderid-user-profile__field-label {
|
|
@@ -2108,6 +2274,7 @@ img.thunderid-user-profile__avatar {
|
|
|
2108
2274
|
text-overflow: ellipsis;
|
|
2109
2275
|
white-space: nowrap;
|
|
2110
2276
|
max-width: 350px;
|
|
2277
|
+
min-width: 0;
|
|
2111
2278
|
text-align: start;
|
|
2112
2279
|
overflow: hidden;
|
|
2113
2280
|
}
|
|
@@ -2788,6 +2955,64 @@ const DIVIDER_CSS = `
|
|
|
2788
2955
|
`;
|
|
2789
2956
|
var Divider_css_default = DIVIDER_CSS;
|
|
2790
2957
|
|
|
2958
|
+
//#endregion
|
|
2959
|
+
//#region src/components/primitives/KeyValueList/KeyValueList.css.ts
|
|
2960
|
+
/**
|
|
2961
|
+
* Styles for the KeyValueList primitive component.
|
|
2962
|
+
*
|
|
2963
|
+
* BEM block: `.thunderid-key-value-list`, built with `withVendorCSSClassPrefix` so the selectors
|
|
2964
|
+
* always match the classes `KeyValueList` renders.
|
|
2965
|
+
*
|
|
2966
|
+
* Elements:
|
|
2967
|
+
* __label | __list | __key | __value
|
|
2968
|
+
*/
|
|
2969
|
+
const KEY_VALUE_LIST_CSS = `
|
|
2970
|
+
/* ============================================================
|
|
2971
|
+
KeyValueList
|
|
2972
|
+
============================================================ */
|
|
2973
|
+
|
|
2974
|
+
.${withVendorCSSClassPrefix("key-value-list")} {
|
|
2975
|
+
display: flex;
|
|
2976
|
+
flex-direction: column;
|
|
2977
|
+
gap: calc(var(--thunderid-spacing-unit) * 0.5);
|
|
2978
|
+
width: 100%;
|
|
2979
|
+
}
|
|
2980
|
+
|
|
2981
|
+
.${withVendorCSSClassPrefix("key-value-list__label")} {
|
|
2982
|
+
color: var(--thunderid-color-text-secondary);
|
|
2983
|
+
font-size: 0.875rem;
|
|
2984
|
+
font-weight: var(--thunderid-typography-fontWeight-medium);
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2987
|
+
/* Two columns rather than a row each, so every value starts at the same edge however long the
|
|
2988
|
+
labels beside them are. */
|
|
2989
|
+
.${withVendorCSSClassPrefix("key-value-list__list")} {
|
|
2990
|
+
background-color: var(--thunderid-color-background-surface);
|
|
2991
|
+
border: 1px solid var(--thunderid-color-border);
|
|
2992
|
+
border-radius: var(--thunderid-border-radius-small);
|
|
2993
|
+
column-gap: calc(var(--thunderid-spacing-unit) * 3);
|
|
2994
|
+
display: grid;
|
|
2995
|
+
grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
|
|
2996
|
+
margin: 0;
|
|
2997
|
+
padding: calc(var(--thunderid-spacing-unit) * 2);
|
|
2998
|
+
row-gap: calc(var(--thunderid-spacing-unit) * 1.5);
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
.${withVendorCSSClassPrefix("key-value-list__key")} {
|
|
3002
|
+
color: var(--thunderid-color-text-secondary);
|
|
3003
|
+
font-size: 0.875rem;
|
|
3004
|
+
}
|
|
3005
|
+
|
|
3006
|
+
.${withVendorCSSClassPrefix("key-value-list__value")} {
|
|
3007
|
+
color: var(--thunderid-color-text-primary);
|
|
3008
|
+
font-size: 0.875rem;
|
|
3009
|
+
font-weight: var(--thunderid-typography-fontWeight-medium);
|
|
3010
|
+
margin: 0;
|
|
3011
|
+
overflow-wrap: anywhere;
|
|
3012
|
+
}
|
|
3013
|
+
`;
|
|
3014
|
+
var KeyValueList_css_default = KEY_VALUE_LIST_CSS;
|
|
3015
|
+
|
|
2791
3016
|
//#endregion
|
|
2792
3017
|
//#region src/components/primitives/Logo/Logo.css.ts
|
|
2793
3018
|
/**
|
|
@@ -3371,55 +3596,6 @@ const TYPOGRAPHY_CSS = `
|
|
|
3371
3596
|
`;
|
|
3372
3597
|
var Typography_css_default = TYPOGRAPHY_CSS;
|
|
3373
3598
|
|
|
3374
|
-
//#endregion
|
|
3375
|
-
//#region src/components/auth/sign-in/BaseSignIn.css.ts
|
|
3376
|
-
/**
|
|
3377
|
-
* Layout styles for the BaseSignIn composition.
|
|
3378
|
-
*
|
|
3379
|
-
* BEM block: `.thunderid-signin`
|
|
3380
|
-
*
|
|
3381
|
-
* Mirrors the layout constants in the React SDK's `BaseSignIn.styles.ts`
|
|
3382
|
-
* (min-width, content gap, logo sizing) so the sign-in card renders with the
|
|
3383
|
-
* same proportions across frameworks.
|
|
3384
|
-
*/
|
|
3385
|
-
const BASE_SIGN_IN_CSS = `
|
|
3386
|
-
/* ============================================================
|
|
3387
|
-
BaseSignIn
|
|
3388
|
-
============================================================ */
|
|
3389
|
-
|
|
3390
|
-
.thunderid-signin {
|
|
3391
|
-
min-width: 420px;
|
|
3392
|
-
margin: 0 auto;
|
|
3393
|
-
font-family: var(--thunderid-typography-fontFamily, inherit);
|
|
3394
|
-
border-radius: var(--thunderid-border-radius-large);
|
|
3395
|
-
}
|
|
3396
|
-
|
|
3397
|
-
.thunderid-signin__content {
|
|
3398
|
-
display: flex;
|
|
3399
|
-
flex-direction: column;
|
|
3400
|
-
gap: calc(var(--thunderid-spacing-unit) * 2);
|
|
3401
|
-
}
|
|
3402
|
-
|
|
3403
|
-
.thunderid-signin__content > img,
|
|
3404
|
-
.thunderid-signin__content > span[role='img'] {
|
|
3405
|
-
/* Flex column's default 'stretch' would otherwise force width: auto to fill
|
|
3406
|
-
the container instead of shrinking to the image's intrinsic size. */
|
|
3407
|
-
align-self: center;
|
|
3408
|
-
display: block;
|
|
3409
|
-
margin: 0 0 calc(var(--thunderid-spacing-unit) * 1) 0;
|
|
3410
|
-
border-radius: var(--thunderid-border-radius-small);
|
|
3411
|
-
}
|
|
3412
|
-
|
|
3413
|
-
.thunderid-signin__messages {
|
|
3414
|
-
margin-top: calc(var(--thunderid-spacing-unit) * 2);
|
|
3415
|
-
}
|
|
3416
|
-
|
|
3417
|
-
.thunderid-signin__messages > * + * {
|
|
3418
|
-
margin-top: calc(var(--thunderid-spacing-unit) * 1);
|
|
3419
|
-
}
|
|
3420
|
-
`;
|
|
3421
|
-
var BaseSignIn_css_default = BASE_SIGN_IN_CSS;
|
|
3422
|
-
|
|
3423
3599
|
//#endregion
|
|
3424
3600
|
//#region src/styles/injectStyles.ts
|
|
3425
3601
|
/**
|
|
@@ -3443,9 +3619,11 @@ const STYLES = [
|
|
|
3443
3619
|
DatePicker_css_default,
|
|
3444
3620
|
OtpField_css_default,
|
|
3445
3621
|
Divider_css_default,
|
|
3622
|
+
KeyValueList_css_default,
|
|
3446
3623
|
Logo_css_default,
|
|
3447
3624
|
Spinner_css_default,
|
|
3448
3625
|
BaseSignIn_css_default,
|
|
3626
|
+
ChangeCredential_css_default,
|
|
3449
3627
|
LanguageSwitcher_css_default,
|
|
3450
3628
|
UserDropdown_css_default,
|
|
3451
3629
|
UserProfile_css_default
|
|
@@ -4219,6 +4397,10 @@ const PencilIcon = () => icon([h("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 2
|
|
|
4219
4397
|
const PasswordField = defineComponent({
|
|
4220
4398
|
name: "PasswordField",
|
|
4221
4399
|
props: {
|
|
4400
|
+
autocomplete: {
|
|
4401
|
+
default: "current-password",
|
|
4402
|
+
type: String
|
|
4403
|
+
},
|
|
4222
4404
|
disabled: {
|
|
4223
4405
|
default: false,
|
|
4224
4406
|
type: Boolean
|
|
@@ -4266,6 +4448,7 @@ const PasswordField = defineComponent({
|
|
|
4266
4448
|
for: props.name
|
|
4267
4449
|
}, [props.label, props.required ? h("span", { class: withVendorCSSClassPrefix("password-field__required") }, " *") : null]) : null,
|
|
4268
4450
|
h("div", { class: withVendorCSSClassPrefix("password-field__wrapper") }, [h("input", {
|
|
4451
|
+
autocomplete: props.autocomplete,
|
|
4269
4452
|
class: withVendorCSSClassPrefix("password-field__input"),
|
|
4270
4453
|
"data-testid": attrs["data-testid"],
|
|
4271
4454
|
disabled: props.disabled,
|
|
@@ -4780,6 +4963,36 @@ const Spinner = defineComponent({
|
|
|
4780
4963
|
});
|
|
4781
4964
|
var Spinner_default = Spinner;
|
|
4782
4965
|
|
|
4966
|
+
//#endregion
|
|
4967
|
+
//#region src/components/primitives/KeyValueList/KeyValueList.ts
|
|
4968
|
+
/**
|
|
4969
|
+
* Displays label and value pairs as a two-column description list, with an optional label above it.
|
|
4970
|
+
*/
|
|
4971
|
+
const KeyValueList = defineComponent({
|
|
4972
|
+
name: "KeyValueList",
|
|
4973
|
+
props: {
|
|
4974
|
+
label: {
|
|
4975
|
+
default: void 0,
|
|
4976
|
+
type: String
|
|
4977
|
+
},
|
|
4978
|
+
pairs: {
|
|
4979
|
+
required: true,
|
|
4980
|
+
type: Array
|
|
4981
|
+
}
|
|
4982
|
+
},
|
|
4983
|
+
setup(props) {
|
|
4984
|
+
const labelId = useId();
|
|
4985
|
+
return () => h("div", { class: withVendorCSSClassPrefix("key-value-list") }, [props.label ? h("span", {
|
|
4986
|
+
class: withVendorCSSClassPrefix("key-value-list__label"),
|
|
4987
|
+
id: labelId
|
|
4988
|
+
}, props.label) : null, h("dl", {
|
|
4989
|
+
"aria-labelledby": props.label ? labelId : void 0,
|
|
4990
|
+
class: withVendorCSSClassPrefix("key-value-list__list")
|
|
4991
|
+
}, props.pairs.flatMap((pair) => [h("dt", { class: withVendorCSSClassPrefix("key-value-list__key") }, pair.label), h("dd", { class: withVendorCSSClassPrefix("key-value-list__value") }, pair.value)]))]);
|
|
4992
|
+
}
|
|
4993
|
+
});
|
|
4994
|
+
var KeyValueList_default = KeyValueList;
|
|
4995
|
+
|
|
4783
4996
|
//#endregion
|
|
4784
4997
|
//#region src/components/actions/BaseSignInButton.ts
|
|
4785
4998
|
/**
|
|
@@ -6325,6 +6538,19 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
|
|
|
6325
6538
|
key
|
|
6326
6539
|
}, timerText);
|
|
6327
6540
|
}
|
|
6541
|
+
case EmbeddedFlowComponentType$1.KeyValueList: {
|
|
6542
|
+
const sourceKey = component.source;
|
|
6543
|
+
const pairs = parseKeyValuePairs$1(sourceKey && options.additionalData ? options.additionalData[sourceKey] : void 0).map((pair) => ({
|
|
6544
|
+
...pair,
|
|
6545
|
+
label: resolve(pair.label)
|
|
6546
|
+
}));
|
|
6547
|
+
if (pairs.length === 0) return null;
|
|
6548
|
+
return h(KeyValueList_default, {
|
|
6549
|
+
key,
|
|
6550
|
+
label: resolve(component.label) || void 0,
|
|
6551
|
+
pairs
|
|
6552
|
+
});
|
|
6553
|
+
}
|
|
6328
6554
|
default:
|
|
6329
6555
|
logger$2.warn(`Unsupported component type: ${component.type}. Skipping render.`);
|
|
6330
6556
|
return null;
|
|
@@ -7622,10 +7848,16 @@ const BaseSignUp = defineComponent({
|
|
|
7622
7848
|
[name]: true
|
|
7623
7849
|
};
|
|
7624
7850
|
};
|
|
7625
|
-
|
|
7851
|
+
let cleanupActivePopup = null;
|
|
7852
|
+
onUnmounted(() => cleanupActivePopup?.());
|
|
7853
|
+
const handleRedirectionIfNeeded = (response, existingPopup) => {
|
|
7626
7854
|
if (response?.type !== EmbeddedFlowResponseType.Redirection || !response?.data?.redirectURL) return false;
|
|
7627
7855
|
const redirectUrl = response.data.redirectURL;
|
|
7628
|
-
const
|
|
7856
|
+
const expectedState = new URL(redirectUrl).searchParams.get("state");
|
|
7857
|
+
const isThisRound = (state) => !expectedState || state === expectedState;
|
|
7858
|
+
const reusablePopup = existingPopup && !existingPopup.closed ? existingPopup : null;
|
|
7859
|
+
if (reusablePopup) reusablePopup.location.href = redirectUrl;
|
|
7860
|
+
const popup = reusablePopup ?? window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
7629
7861
|
if (!popup) {
|
|
7630
7862
|
logger$1.error("Failed to open popup window");
|
|
7631
7863
|
return false;
|
|
@@ -7637,6 +7869,7 @@ const BaseSignUp = defineComponent({
|
|
|
7637
7869
|
if (messageHandler) window.removeEventListener("message", messageHandler);
|
|
7638
7870
|
if (popupMonitor) clearInterval(popupMonitor);
|
|
7639
7871
|
};
|
|
7872
|
+
cleanupActivePopup = cleanup;
|
|
7640
7873
|
const processOAuthCode = async (code, state) => {
|
|
7641
7874
|
const payload = {
|
|
7642
7875
|
...currentFlow.value?.flowId && { flowId: currentFlow.value.flowId },
|
|
@@ -7649,15 +7882,24 @@ const BaseSignUp = defineComponent({
|
|
|
7649
7882
|
};
|
|
7650
7883
|
try {
|
|
7651
7884
|
const continueResponse = await props.onSubmit(payload);
|
|
7885
|
+
cleanup();
|
|
7652
7886
|
props.onFlowChange?.(continueResponse);
|
|
7653
7887
|
if (continueResponse.flowStatus === EmbeddedSignUpFlowStatus$1.Complete) props.onComplete?.(continueResponse);
|
|
7654
7888
|
else if (continueResponse.flowStatus === EmbeddedSignUpFlowStatus$1.Incomplete) {
|
|
7889
|
+
if (continueResponse?.type === EmbeddedFlowResponseType.Redirection) {
|
|
7890
|
+
if (!handleRedirectionIfNeeded(continueResponse, popup)) {
|
|
7891
|
+
popup.close();
|
|
7892
|
+
const popupError = new Error(t("errors.signup.popup.failure"));
|
|
7893
|
+
handleError(popupError);
|
|
7894
|
+
props.onError?.(popupError);
|
|
7895
|
+
}
|
|
7896
|
+
return;
|
|
7897
|
+
}
|
|
7655
7898
|
currentFlow.value = continueResponse;
|
|
7656
7899
|
setupFormFields(continueResponse);
|
|
7657
7900
|
if (continueResponse?.error) handleError(continueResponse);
|
|
7658
7901
|
}
|
|
7659
7902
|
popup.close();
|
|
7660
|
-
cleanup();
|
|
7661
7903
|
} catch (err) {
|
|
7662
7904
|
handleError(err);
|
|
7663
7905
|
props.onError?.(err);
|
|
@@ -7670,7 +7912,10 @@ const BaseSignUp = defineComponent({
|
|
|
7670
7912
|
const expectedOrigin = props.afterSignUpUrl ? new URL(props.afterSignUpUrl).origin : window.location.origin;
|
|
7671
7913
|
if (event.origin !== expectedOrigin && event.origin !== window.location.origin) return;
|
|
7672
7914
|
const { code, state } = event.data;
|
|
7673
|
-
if (code && state
|
|
7915
|
+
if (code && state && isThisRound(state) && !hasProcessedCallback) {
|
|
7916
|
+
hasProcessedCallback = true;
|
|
7917
|
+
await processOAuthCode(code, state);
|
|
7918
|
+
}
|
|
7674
7919
|
};
|
|
7675
7920
|
window.addEventListener("message", messageHandler);
|
|
7676
7921
|
popupMonitor = setInterval(async () => {
|
|
@@ -7683,11 +7928,13 @@ const BaseSignUp = defineComponent({
|
|
|
7683
7928
|
try {
|
|
7684
7929
|
const popupUrl = popup.location.href;
|
|
7685
7930
|
if (popupUrl && (popupUrl.includes("code=") || popupUrl.includes("error="))) {
|
|
7686
|
-
hasProcessedCallback = true;
|
|
7687
7931
|
const url = new URL(popupUrl);
|
|
7688
7932
|
const code = url.searchParams.get("code");
|
|
7689
7933
|
const state = url.searchParams.get("state");
|
|
7690
|
-
|
|
7934
|
+
const error = url.searchParams.get("error");
|
|
7935
|
+
if (!isThisRound(state)) return;
|
|
7936
|
+
hasProcessedCallback = true;
|
|
7937
|
+
if (error) {
|
|
7691
7938
|
logger$1.error("OAuth error");
|
|
7692
7939
|
popup.close();
|
|
7693
7940
|
cleanup();
|
|
@@ -7872,6 +8119,7 @@ const BaseSignUp = defineComponent({
|
|
|
7872
8119
|
const { title, subtitle, componentsWithoutHeadings } = getAuthComponentHeadings_default(currentFlow.value.data?.components || [], void 0, void 0, t("signup.heading") || "Sign Up", t("signup.subheading") || "Create your account");
|
|
7873
8120
|
const meta = flowMetaRef.value;
|
|
7874
8121
|
const renderedComponents = componentsWithoutHeadings.length > 0 ? renderSignUpComponents(componentsWithoutHeadings, formValues.value, touchedFields.value, formErrors.value, isLoading.value, isFormValid.value, resetForm, handleInputChange, {
|
|
8122
|
+
additionalData: currentFlow.value.data?.additionalData,
|
|
7875
8123
|
buttonClassName: props.buttonClassName,
|
|
7876
8124
|
inputClassName: props.inputClassName,
|
|
7877
8125
|
meta,
|
|
@@ -8745,6 +8993,301 @@ const UserProfile = defineComponent({
|
|
|
8745
8993
|
});
|
|
8746
8994
|
var UserProfile_default = UserProfile;
|
|
8747
8995
|
|
|
8996
|
+
//#endregion
|
|
8997
|
+
//#region src/components/presentation/change-credential/BaseChangeCredential.ts
|
|
8998
|
+
const ruleIcon = (passed) => passed ? CheckIcon() : XIcon();
|
|
8999
|
+
/**
|
|
9000
|
+
* Presentational change-credential form with just the two fields a first-time or
|
|
9001
|
+
* unverified credential change needs: new value and confirmation.
|
|
9002
|
+
*
|
|
9003
|
+
* Holds no context and performs no network calls: it renders the fields, evaluates the
|
|
9004
|
+
* policy for the checklist and the submit gate, and emits `submit` with the validated
|
|
9005
|
+
* values. Use `ChangeCredential` for the context-wired variant.
|
|
9006
|
+
*/
|
|
9007
|
+
const BaseChangeCredential = defineComponent({
|
|
9008
|
+
name: "BaseChangeCredential",
|
|
9009
|
+
props: {
|
|
9010
|
+
cardLayout: {
|
|
9011
|
+
default: false,
|
|
9012
|
+
type: Boolean
|
|
9013
|
+
},
|
|
9014
|
+
className: {
|
|
9015
|
+
default: "",
|
|
9016
|
+
type: String
|
|
9017
|
+
},
|
|
9018
|
+
credentialDisplayName: {
|
|
9019
|
+
default: "Password",
|
|
9020
|
+
type: String
|
|
9021
|
+
},
|
|
9022
|
+
error: {
|
|
9023
|
+
default: null,
|
|
9024
|
+
type: String
|
|
9025
|
+
},
|
|
9026
|
+
fieldErrors: {
|
|
9027
|
+
default: () => ({}),
|
|
9028
|
+
type: Object
|
|
9029
|
+
},
|
|
9030
|
+
loading: {
|
|
9031
|
+
default: false,
|
|
9032
|
+
type: Boolean
|
|
9033
|
+
},
|
|
9034
|
+
policy: {
|
|
9035
|
+
default: () => ({}),
|
|
9036
|
+
type: Object
|
|
9037
|
+
},
|
|
9038
|
+
preferences: {
|
|
9039
|
+
default: void 0,
|
|
9040
|
+
type: Object
|
|
9041
|
+
},
|
|
9042
|
+
showRequirements: {
|
|
9043
|
+
default: true,
|
|
9044
|
+
type: Boolean
|
|
9045
|
+
},
|
|
9046
|
+
success: {
|
|
9047
|
+
default: false,
|
|
9048
|
+
type: Boolean
|
|
9049
|
+
},
|
|
9050
|
+
t: {
|
|
9051
|
+
default: void 0,
|
|
9052
|
+
type: Function
|
|
9053
|
+
},
|
|
9054
|
+
title: {
|
|
9055
|
+
default: void 0,
|
|
9056
|
+
type: String
|
|
9057
|
+
},
|
|
9058
|
+
unavailable: {
|
|
9059
|
+
default: false,
|
|
9060
|
+
type: Boolean
|
|
9061
|
+
}
|
|
9062
|
+
},
|
|
9063
|
+
emits: ["submit"],
|
|
9064
|
+
setup(props, { emit }) {
|
|
9065
|
+
const { t: fallbackT } = useI18n_default();
|
|
9066
|
+
const labelParams = computed(() => ({
|
|
9067
|
+
credential: props.credentialDisplayName,
|
|
9068
|
+
credentialLower: props.credentialDisplayName.toLowerCase()
|
|
9069
|
+
}));
|
|
9070
|
+
const translate = (key, params) => (props.t ?? fallbackT)(key, {
|
|
9071
|
+
...labelParams.value,
|
|
9072
|
+
...params
|
|
9073
|
+
});
|
|
9074
|
+
const resolvedTitle = computed(() => props.title ?? translate("user.change_password.heading"));
|
|
9075
|
+
const newPassword = ref("");
|
|
9076
|
+
const confirmPassword = ref("");
|
|
9077
|
+
const submitted = ref(false);
|
|
9078
|
+
watch(() => props.success, (succeeded) => {
|
|
9079
|
+
if (!succeeded) return;
|
|
9080
|
+
newPassword.value = "";
|
|
9081
|
+
confirmPassword.value = "";
|
|
9082
|
+
submitted.value = false;
|
|
9083
|
+
});
|
|
9084
|
+
const evaluation = computed(() => evaluateChangePasswordForm({
|
|
9085
|
+
confirmPassword: confirmPassword.value,
|
|
9086
|
+
newPassword: newPassword.value
|
|
9087
|
+
}, props.policy));
|
|
9088
|
+
const ruleResults = computed(() => evaluation.value.ruleResults);
|
|
9089
|
+
const confirmMatches = computed(() => evaluation.value.confirmMatches);
|
|
9090
|
+
const interactionDisabled = computed(() => props.loading || props.unavailable);
|
|
9091
|
+
const canSubmit = computed(() => !interactionDisabled.value && evaluation.value.isValid);
|
|
9092
|
+
function handleSubmit(event) {
|
|
9093
|
+
event.preventDefault();
|
|
9094
|
+
submitted.value = true;
|
|
9095
|
+
if (!canSubmit.value) return;
|
|
9096
|
+
emit("submit", { newPassword: newPassword.value });
|
|
9097
|
+
}
|
|
9098
|
+
return () => {
|
|
9099
|
+
const rootClass = [
|
|
9100
|
+
withVendorCSSClassPrefix("change-credential"),
|
|
9101
|
+
props.cardLayout ? withVendorCSSClassPrefix("change-credential--card") : "",
|
|
9102
|
+
props.className
|
|
9103
|
+
].filter(Boolean).join(" ");
|
|
9104
|
+
const confirmError = submitted.value && !confirmMatches.value ? translate("user.change_password.mismatch.error") : void 0;
|
|
9105
|
+
const newPasswordError = props.fieldErrors["newPassword"];
|
|
9106
|
+
const form = h("form", {
|
|
9107
|
+
class: rootClass,
|
|
9108
|
+
novalidate: true,
|
|
9109
|
+
onSubmit: handleSubmit
|
|
9110
|
+
}, [
|
|
9111
|
+
resolvedTitle.value ? h("h3", { class: withVendorCSSClassPrefix("change-credential__heading") }, resolvedTitle.value) : null,
|
|
9112
|
+
props.error ? h(Alert_default, { severity: "error" }, { default: () => [props.error] }) : null,
|
|
9113
|
+
props.success ? h(Alert_default, { severity: "success" }, { default: () => [translate("user.change_password.success")] }) : null,
|
|
9114
|
+
h("div", { class: withVendorCSSClassPrefix("change-credential__fields") }, [
|
|
9115
|
+
h(PasswordField_default, {
|
|
9116
|
+
autocomplete: "new-password",
|
|
9117
|
+
disabled: interactionDisabled.value,
|
|
9118
|
+
error: newPasswordError,
|
|
9119
|
+
label: translate("user.change_password.new.label"),
|
|
9120
|
+
modelValue: newPassword.value,
|
|
9121
|
+
name: "newPassword",
|
|
9122
|
+
"onUpdate:modelValue": (value) => {
|
|
9123
|
+
newPassword.value = value;
|
|
9124
|
+
},
|
|
9125
|
+
placeholder: translate("user.change_password.new.placeholder"),
|
|
9126
|
+
required: true
|
|
9127
|
+
}),
|
|
9128
|
+
props.showRequirements && ruleResults.value.length > 0 ? h("div", {}, [h("p", { class: withVendorCSSClassPrefix("change-credential__requirements-heading") }, translate("user.change_password.requirements.heading")), h("ul", { class: withVendorCSSClassPrefix("change-credential__requirements") }, ruleResults.value.map((rule) => h("li", {
|
|
9129
|
+
class: [withVendorCSSClassPrefix("change-credential__requirement"), rule.passed ? withVendorCSSClassPrefix("change-credential__requirement--passed") : ""].filter(Boolean).join(" "),
|
|
9130
|
+
"data-passed": String(rule.passed),
|
|
9131
|
+
key: rule.key
|
|
9132
|
+
}, [h("span", { class: withVendorCSSClassPrefix("change-credential__requirement-icon") }, [ruleIcon(rule.passed)]), h("span", {}, translate(rule.messageKey, rule.params))])))]) : null,
|
|
9133
|
+
h(PasswordField_default, {
|
|
9134
|
+
autocomplete: "new-password",
|
|
9135
|
+
disabled: interactionDisabled.value,
|
|
9136
|
+
error: confirmError,
|
|
9137
|
+
label: translate("user.change_password.confirm.label"),
|
|
9138
|
+
modelValue: confirmPassword.value,
|
|
9139
|
+
name: "confirmPassword",
|
|
9140
|
+
"onUpdate:modelValue": (value) => {
|
|
9141
|
+
confirmPassword.value = value;
|
|
9142
|
+
},
|
|
9143
|
+
placeholder: translate("user.change_password.confirm.placeholder"),
|
|
9144
|
+
required: true
|
|
9145
|
+
})
|
|
9146
|
+
]),
|
|
9147
|
+
h("div", { class: withVendorCSSClassPrefix("change-credential__actions") }, [h(Button_default, {
|
|
9148
|
+
color: "primary",
|
|
9149
|
+
disabled: !canSubmit.value,
|
|
9150
|
+
loading: props.loading,
|
|
9151
|
+
type: "submit",
|
|
9152
|
+
variant: "solid"
|
|
9153
|
+
}, { default: () => [translate("user.change_password.submit")] })])
|
|
9154
|
+
]);
|
|
9155
|
+
if (!props.unavailable) return form;
|
|
9156
|
+
return h("div", { class: withVendorCSSClassPrefix("change-credential__unavailable") }, [h("div", {
|
|
9157
|
+
"aria-hidden": "true",
|
|
9158
|
+
class: withVendorCSSClassPrefix("change-credential__unavailable-content")
|
|
9159
|
+
}, [form]), h("div", {
|
|
9160
|
+
class: withVendorCSSClassPrefix("change-credential__unavailable-overlay"),
|
|
9161
|
+
role: "status"
|
|
9162
|
+
}, [h(Alert_default, { severity: "warning" }, { default: () => [h("strong", translate("user.change_password.unavailable.heading")), h("div", translate("user.change_password.unavailable.description"))] })])]);
|
|
9163
|
+
};
|
|
9164
|
+
}
|
|
9165
|
+
});
|
|
9166
|
+
var BaseChangeCredential_default = BaseChangeCredential;
|
|
9167
|
+
|
|
9168
|
+
//#endregion
|
|
9169
|
+
//#region src/api/updateMeCredentials.ts
|
|
9170
|
+
const updateMeCredentials$1 = async ({ fetcher, instanceId = 0,...requestConfig }) => {
|
|
9171
|
+
return updateMeCredentials({
|
|
9172
|
+
...requestConfig,
|
|
9173
|
+
fetcher: fetcher || createHttpClientFetcher(instanceId)
|
|
9174
|
+
});
|
|
9175
|
+
};
|
|
9176
|
+
var updateMeCredentials_default = updateMeCredentials$1;
|
|
9177
|
+
|
|
9178
|
+
//#endregion
|
|
9179
|
+
//#region src/components/presentation/change-credential/ChangeCredential.ts
|
|
9180
|
+
/**
|
|
9181
|
+
* Title-cases a credential attribute name for use as a display-name fallback when the schema
|
|
9182
|
+
* declares no `displayName` for it, e.g. `pin` -> `Pin`.
|
|
9183
|
+
*/
|
|
9184
|
+
const defaultDisplayName = (attribute) => attribute.charAt(0).toUpperCase() + attribute.slice(1);
|
|
9185
|
+
/**
|
|
9186
|
+
* ChangeCredential lets the signed-in user set a new value for one of their own credentials.
|
|
9187
|
+
*
|
|
9188
|
+
* It collects only a new value and its confirmation. The self-service credential write path
|
|
9189
|
+
* does not verify the account's existing value today, so this component does not ask for one;
|
|
9190
|
+
* once server-side current-value verification ships, that field returns without a breaking
|
|
9191
|
+
* change to this component's public props.
|
|
9192
|
+
*/
|
|
9193
|
+
const ChangeCredential = defineComponent({
|
|
9194
|
+
name: "ChangeCredential",
|
|
9195
|
+
props: {
|
|
9196
|
+
attribute: {
|
|
9197
|
+
default: CredentialConstants.PASSWORD,
|
|
9198
|
+
type: String
|
|
9199
|
+
},
|
|
9200
|
+
cardLayout: {
|
|
9201
|
+
default: false,
|
|
9202
|
+
type: Boolean
|
|
9203
|
+
},
|
|
9204
|
+
className: {
|
|
9205
|
+
default: "",
|
|
9206
|
+
type: String
|
|
9207
|
+
},
|
|
9208
|
+
policy: {
|
|
9209
|
+
default: void 0,
|
|
9210
|
+
type: Object
|
|
9211
|
+
},
|
|
9212
|
+
preferences: {
|
|
9213
|
+
default: void 0,
|
|
9214
|
+
type: Object
|
|
9215
|
+
},
|
|
9216
|
+
showRequirements: {
|
|
9217
|
+
default: true,
|
|
9218
|
+
type: Boolean
|
|
9219
|
+
},
|
|
9220
|
+
title: {
|
|
9221
|
+
default: void 0,
|
|
9222
|
+
type: String
|
|
9223
|
+
}
|
|
9224
|
+
},
|
|
9225
|
+
emits: ["success"],
|
|
9226
|
+
setup(props, { emit }) {
|
|
9227
|
+
const { baseUrl, endpoints, instanceId, preferences: contextPreferences } = useThunderID_default();
|
|
9228
|
+
const { userSchema } = useUser_default();
|
|
9229
|
+
const { t } = useI18n_default();
|
|
9230
|
+
const resolvedDisplayName = computed(() => userSchema?.value?.[props.attribute]?.displayName ?? defaultDisplayName(props.attribute));
|
|
9231
|
+
const resolvedPreferences = computed(() => ({
|
|
9232
|
+
...contextPreferences,
|
|
9233
|
+
...props.preferences,
|
|
9234
|
+
user: {
|
|
9235
|
+
...contextPreferences?.user,
|
|
9236
|
+
...props.preferences?.user
|
|
9237
|
+
}
|
|
9238
|
+
}));
|
|
9239
|
+
const error = ref(null);
|
|
9240
|
+
const fieldErrors = ref({});
|
|
9241
|
+
const loading = ref(false);
|
|
9242
|
+
const success = ref(false);
|
|
9243
|
+
const resolvedPolicy = computed(() => resolveChangeCredentialPolicy(userSchema?.value, props.attribute, props.policy));
|
|
9244
|
+
async function handleSubmit({ newPassword }) {
|
|
9245
|
+
error.value = null;
|
|
9246
|
+
fieldErrors.value = {};
|
|
9247
|
+
success.value = false;
|
|
9248
|
+
loading.value = true;
|
|
9249
|
+
try {
|
|
9250
|
+
await updateMeCredentials_default({
|
|
9251
|
+
baseUrl,
|
|
9252
|
+
instanceId,
|
|
9253
|
+
payload: { [props.attribute]: newPassword },
|
|
9254
|
+
url: resolveResourceEndpoint("usersMeCredentials", { endpoints })
|
|
9255
|
+
});
|
|
9256
|
+
success.value = true;
|
|
9257
|
+
emit("success");
|
|
9258
|
+
} catch (caughtError) {
|
|
9259
|
+
const { field, message, messageKey } = mapCredentialUpdateError(caughtError);
|
|
9260
|
+
const text = message ?? t(messageKey, {
|
|
9261
|
+
credential: resolvedDisplayName.value,
|
|
9262
|
+
credentialLower: resolvedDisplayName.value.toLowerCase()
|
|
9263
|
+
});
|
|
9264
|
+
if (field) fieldErrors.value = { [field]: text };
|
|
9265
|
+
else error.value = text;
|
|
9266
|
+
} finally {
|
|
9267
|
+
loading.value = false;
|
|
9268
|
+
}
|
|
9269
|
+
}
|
|
9270
|
+
return () => h(BaseChangeCredential_default, {
|
|
9271
|
+
cardLayout: props.cardLayout,
|
|
9272
|
+
class: withVendorCSSClassPrefix("change-credential--styled"),
|
|
9273
|
+
className: props.className,
|
|
9274
|
+
credentialDisplayName: resolvedDisplayName.value,
|
|
9275
|
+
error: error.value,
|
|
9276
|
+
fieldErrors: fieldErrors.value,
|
|
9277
|
+
loading: loading.value,
|
|
9278
|
+
onSubmit: handleSubmit,
|
|
9279
|
+
policy: resolvedPolicy.value,
|
|
9280
|
+
preferences: resolvedPreferences.value,
|
|
9281
|
+
showRequirements: props.showRequirements,
|
|
9282
|
+
success: success.value,
|
|
9283
|
+
t,
|
|
9284
|
+
title: props.title,
|
|
9285
|
+
unavailable: !supportsCredential(userSchema?.value, props.attribute)
|
|
9286
|
+
});
|
|
9287
|
+
}
|
|
9288
|
+
});
|
|
9289
|
+
var ChangeCredential_default = ChangeCredential;
|
|
9290
|
+
|
|
8748
9291
|
//#endregion
|
|
8749
9292
|
//#region src/components/presentation/user-dropdown/BaseUserDropdown.ts
|
|
8750
9293
|
const DEFAULT_ATTRIBUTE_MAPPINGS = {
|
|
@@ -8836,10 +9379,18 @@ const BaseUserDropdown = defineComponent({
|
|
|
8836
9379
|
default: null,
|
|
8837
9380
|
type: Object
|
|
8838
9381
|
},
|
|
9382
|
+
profileLabel: {
|
|
9383
|
+
default: "Profile",
|
|
9384
|
+
type: String
|
|
9385
|
+
},
|
|
8839
9386
|
showChevron: {
|
|
8840
9387
|
default: false,
|
|
8841
9388
|
type: Boolean
|
|
8842
9389
|
},
|
|
9390
|
+
showTriggerLabel: {
|
|
9391
|
+
default: false,
|
|
9392
|
+
type: Boolean
|
|
9393
|
+
},
|
|
8843
9394
|
size: {
|
|
8844
9395
|
default: "md",
|
|
8845
9396
|
type: String
|
|
@@ -8927,17 +9478,21 @@ const BaseUserDropdown = defineComponent({
|
|
|
8927
9478
|
isOpen.value = !isOpen.value;
|
|
8928
9479
|
},
|
|
8929
9480
|
type: "button"
|
|
8930
|
-
}, [
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
9481
|
+
}, [
|
|
9482
|
+
picture && !avatarImageError.value ? h("img", {
|
|
9483
|
+
alt: displayName,
|
|
9484
|
+
class: [px("user-dropdown__avatar"), avatarSizeClass].filter(Boolean).join(" "),
|
|
9485
|
+
onError: () => {
|
|
9486
|
+
avatarImageError.value = true;
|
|
9487
|
+
},
|
|
9488
|
+
src: picture
|
|
9489
|
+
}) : h("span", {
|
|
9490
|
+
class: [px("user-dropdown__avatar"), avatarSizeClass].filter(Boolean).join(" "),
|
|
9491
|
+
style: { background: gradient }
|
|
9492
|
+
}, initials),
|
|
9493
|
+
props.showTriggerLabel ? h("span", { class: px("user-dropdown__trigger-label") }, displayName) : null,
|
|
9494
|
+
props.showChevron ? h("span", { class: px("user-dropdown__chevron") }, [h(ChevronDownIcon, { size: 14 })]) : null
|
|
9495
|
+
]);
|
|
8941
9496
|
let menu = null;
|
|
8942
9497
|
if (isOpen.value) {
|
|
8943
9498
|
const alignClass = resolveMenuAlign() === "left" ? px("user-dropdown__menu--align-left") : "";
|
|
@@ -8964,7 +9519,7 @@ const BaseUserDropdown = defineComponent({
|
|
|
8964
9519
|
props.onProfileClick();
|
|
8965
9520
|
},
|
|
8966
9521
|
type: "button"
|
|
8967
|
-
}, [h(UserIcon, { size: 15 }), h("span", null, "Profile")]));
|
|
9522
|
+
}, [h(UserIcon, { size: 15 }), h("span", null, props.profileLabel ?? "Profile")]));
|
|
8968
9523
|
if (props.menuItems && props.menuItems.length > 0) props.menuItems.forEach((item, idx) => {
|
|
8969
9524
|
if (item.separatorBefore) menuChildren.push(h("div", {
|
|
8970
9525
|
class: px("user-dropdown__menu-divider"),
|
|
@@ -9059,6 +9614,14 @@ const UserDropdown = defineComponent({
|
|
|
9059
9614
|
default: void 0,
|
|
9060
9615
|
type: Array
|
|
9061
9616
|
},
|
|
9617
|
+
onManageProfile: {
|
|
9618
|
+
default: void 0,
|
|
9619
|
+
type: Function
|
|
9620
|
+
},
|
|
9621
|
+
profileLabel: {
|
|
9622
|
+
default: void 0,
|
|
9623
|
+
type: String
|
|
9624
|
+
},
|
|
9062
9625
|
showChevron: {
|
|
9063
9626
|
default: false,
|
|
9064
9627
|
type: Boolean
|
|
@@ -9066,6 +9629,10 @@ const UserDropdown = defineComponent({
|
|
|
9066
9629
|
size: {
|
|
9067
9630
|
default: "md",
|
|
9068
9631
|
type: String
|
|
9632
|
+
},
|
|
9633
|
+
showTriggerLabel: {
|
|
9634
|
+
default: false,
|
|
9635
|
+
type: Boolean
|
|
9069
9636
|
}
|
|
9070
9637
|
},
|
|
9071
9638
|
emits: ["profileClick"],
|
|
@@ -9079,6 +9646,10 @@ const UserDropdown = defineComponent({
|
|
|
9079
9646
|
menuAlign: props.menuAlign,
|
|
9080
9647
|
menuItems: props.menuItems,
|
|
9081
9648
|
onProfileClick: () => {
|
|
9649
|
+
if (props.onManageProfile) {
|
|
9650
|
+
props.onManageProfile();
|
|
9651
|
+
return;
|
|
9652
|
+
}
|
|
9082
9653
|
isProfileModalOpen.value = true;
|
|
9083
9654
|
emit("profileClick");
|
|
9084
9655
|
},
|
|
@@ -9088,12 +9659,14 @@ const UserDropdown = defineComponent({
|
|
|
9088
9659
|
onSignOut: () => {
|
|
9089
9660
|
signOut();
|
|
9090
9661
|
},
|
|
9091
|
-
profileContent: isProfileModalOpen.value ? h(UserProfile_default, {
|
|
9662
|
+
profileContent: !props.onManageProfile && isProfileModalOpen.value ? h(UserProfile_default, {
|
|
9092
9663
|
cardLayout: false,
|
|
9093
9664
|
compact: true,
|
|
9094
9665
|
editable: true
|
|
9095
9666
|
}) : null,
|
|
9667
|
+
profileLabel: props.profileLabel,
|
|
9096
9668
|
showChevron: props.showChevron,
|
|
9669
|
+
showTriggerLabel: props.showTriggerLabel,
|
|
9097
9670
|
size: props.size,
|
|
9098
9671
|
user: user.value
|
|
9099
9672
|
}, slots);
|
|
@@ -10318,4 +10891,4 @@ const createCallbackRoute = (options = {}) => {
|
|
|
10318
10891
|
};
|
|
10319
10892
|
|
|
10320
10893
|
//#endregion
|
|
10321
|
-
export { AcceptInvite_default as AcceptInvite, Alert_default as Alert, ArrowLeftRightIcon, BaseAcceptInvite_default as BaseAcceptInvite, BaseInviteUser_default as BaseInviteUser, BaseLanguageSwitcher_default as BaseLanguageSwitcher, BaseSignIn_default as BaseSignIn, BaseSignInButton_default as BaseSignInButton, BaseSignOutButton_default as BaseSignOutButton, BaseSignUp_default as BaseSignUp, BaseSignUpButton_default as BaseSignUpButton, BaseUserDropdown_default as BaseUserDropdown, BaseUserProfile_default as BaseUserProfile, BuildingIcon, Button_default as Button, Callback_default as Callback, Card_default as Card, CheckIcon, Checkbox_default as Checkbox, ChevronDownIcon, CircleAlertIcon, CircleCheckIcon, DatePicker_default as DatePicker, Divider_default as Divider, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowEventType, EmbeddedFlowTextVariant, EmbeddedSignInFlowStatus, EmbeddedSignInFlowType, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowType, EyeIcon, EyeOffIcon, FLOW_KEY, FLOW_META_KEY, FacebookButton_default as FacebookButton, FieldFactory_default as FieldFactory, FieldType, FlowMetaProvider_default as FlowMetaProvider, FlowProvider_default as FlowProvider, GitHubButton_default as GitHubButton, GlobeIcon, GoogleButton_default as GoogleButton, I18N_KEY, I18nProvider_default as I18nProvider, InfoIcon, InviteUser_default as InviteUser, LanguageSwitcher_default as LanguageSwitcher, Loading_default as Loading, LogOutIcon, Logo_default as Logo, MicrosoftButton_default as MicrosoftButton, OtpField_default as OtpField, PasswordField_default as PasswordField, PencilIcon, PlusIcon, Select_default as Select, SignIn_default as SignIn, SignInButton_default as SignInButton, SignOutButton_default as SignOutButton, SignUp_default as SignUp, SignUpButton_default as SignUpButton, SignedIn_default as SignedIn, SignedOut_default as SignedOut, Spinner_default as Spinner, THEME_KEY, THUNDERID_KEY, TextField_default as TextField, ThemeProvider_default as ThemeProvider, ThunderIDPlugin_default as ThunderIDPlugin, ThunderIDProvider_default as ThunderIDProvider, ThunderIDRuntimeError, ThunderIDVueClient_default as ThunderIDVueClient, TriangleAlertIcon, Typography_default as Typography, USER_KEY, User_default as User, UserDropdown_default as UserDropdown, UserIcon, UserProfile_default as UserProfile, UserProvider_default as UserProvider, XIcon, buildThemeConfigFromFlowMeta_default as buildThemeConfigFromFlowMeta, createCallbackRoute, createClassObserver, createField, createMediaQueryListener, createThunderIDGuard, detectThemeMode, extractErrorMessage, getActiveTheme, getAuthComponentHeadings_default as getAuthComponentHeadings, getUsersMeMeta_default as getUsersMeMeta, handlePasskeyAuthentication, handlePasskeyRegistration, handleWebAuthnAuthentication, hasAuthParamsInUrl, http, initiateOAuthRedirect, navigate, normalizeFlowResponse, useFlow_default as useFlow, useFlowMeta_default as useFlowMeta, useI18n_default as useI18n, useOAuthCallback, useTheme_default as useTheme, useThunderID_default as useThunderID, useUser_default as useUser, validateFieldValue };
|
|
10894
|
+
export { AcceptInvite_default as AcceptInvite, Alert_default as Alert, ArrowLeftRightIcon, BaseAcceptInvite_default as BaseAcceptInvite, BaseChangeCredential_default as BaseChangeCredential, BaseInviteUser_default as BaseInviteUser, BaseLanguageSwitcher_default as BaseLanguageSwitcher, BaseSignIn_default as BaseSignIn, BaseSignInButton_default as BaseSignInButton, BaseSignOutButton_default as BaseSignOutButton, BaseSignUp_default as BaseSignUp, BaseSignUpButton_default as BaseSignUpButton, BaseUserDropdown_default as BaseUserDropdown, BaseUserProfile_default as BaseUserProfile, BuildingIcon, Button_default as Button, Callback_default as Callback, Card_default as Card, ChangeCredential_default as ChangeCredential, CheckIcon, Checkbox_default as Checkbox, ChevronDownIcon, CircleAlertIcon, CircleCheckIcon, DatePicker_default as DatePicker, Divider_default as Divider, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowEventType, EmbeddedFlowTextVariant, EmbeddedSignInFlowStatus, EmbeddedSignInFlowType, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowType, EyeIcon, EyeOffIcon, FLOW_KEY, FLOW_META_KEY, FacebookButton_default as FacebookButton, FieldFactory_default as FieldFactory, FieldType, FlowMetaProvider_default as FlowMetaProvider, FlowProvider_default as FlowProvider, GitHubButton_default as GitHubButton, GlobeIcon, GoogleButton_default as GoogleButton, I18N_KEY, I18nProvider_default as I18nProvider, InfoIcon, InviteUser_default as InviteUser, KeyValueList_default as KeyValueList, LanguageSwitcher_default as LanguageSwitcher, Loading_default as Loading, LogOutIcon, Logo_default as Logo, MicrosoftButton_default as MicrosoftButton, OtpField_default as OtpField, PasswordField_default as PasswordField, PencilIcon, PlusIcon, Select_default as Select, SignIn_default as SignIn, SignInButton_default as SignInButton, SignOutButton_default as SignOutButton, SignUp_default as SignUp, SignUpButton_default as SignUpButton, SignedIn_default as SignedIn, SignedOut_default as SignedOut, Spinner_default as Spinner, THEME_KEY, THUNDERID_KEY, TextField_default as TextField, ThemeProvider_default as ThemeProvider, ThunderIDPlugin_default as ThunderIDPlugin, ThunderIDProvider_default as ThunderIDProvider, ThunderIDRuntimeError, ThunderIDVueClient_default as ThunderIDVueClient, TriangleAlertIcon, Typography_default as Typography, USER_KEY, User_default as User, UserDropdown_default as UserDropdown, UserIcon, UserProfile_default as UserProfile, UserProvider_default as UserProvider, XIcon, buildThemeConfigFromFlowMeta_default as buildThemeConfigFromFlowMeta, createCallbackRoute, createClassObserver, createField, createMediaQueryListener, createThunderIDGuard, detectThemeMode, extractErrorMessage, getActiveTheme, getAuthComponentHeadings_default as getAuthComponentHeadings, getUsersMeMeta_default as getUsersMeMeta, handlePasskeyAuthentication, handlePasskeyRegistration, handleWebAuthnAuthentication, hasAuthParamsInUrl, http, initiateOAuthRedirect, navigate, normalizeFlowResponse, parseKeyValuePairs, useFlow_default as useFlow, useFlowMeta_default as useFlowMeta, useI18n_default as useI18n, useOAuthCallback, useTheme_default as useTheme, useThunderID_default as useThunderID, useUser_default as useUser, validateFieldValue };
|