@thunderid/vue 1.21.1 → 1.22.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/cjs/index.cjs +225 -10
- package/dist/components/auth/flow/AuthOptionFactoryCore.d.ts.map +1 -1
- package/dist/components/auth/flow/Consent.css.d.ts.map +1 -1
- package/dist/components/auth/flow/Consent.d.ts +4 -0
- package/dist/components/auth/flow/Consent.d.ts.map +1 -1
- package/dist/index.js +227 -12
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -3064,6 +3064,79 @@ const CONSENT_CSS = `
|
|
|
3064
3064
|
cursor: not-allowed;
|
|
3065
3065
|
opacity: 0.4;
|
|
3066
3066
|
}
|
|
3067
|
+
|
|
3068
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity")} {
|
|
3069
|
+
display: flex;
|
|
3070
|
+
flex-direction: column;
|
|
3071
|
+
gap: calc(var(--thunderid-spacing-unit) * 2);
|
|
3072
|
+
margin-top: var(--thunderid-spacing-unit);
|
|
3073
|
+
}
|
|
3074
|
+
|
|
3075
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-group")} {
|
|
3076
|
+
display: flex;
|
|
3077
|
+
flex-direction: column;
|
|
3078
|
+
gap: calc(var(--thunderid-spacing-unit) * 0.5);
|
|
3079
|
+
}
|
|
3080
|
+
|
|
3081
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-remember")} {
|
|
3082
|
+
display: flex;
|
|
3083
|
+
align-items: center;
|
|
3084
|
+
gap: var(--thunderid-spacing-unit);
|
|
3085
|
+
color: var(--thunderid-color-text-primary);
|
|
3086
|
+
font-size: var(--thunderid-typography-fontSize-sm);
|
|
3087
|
+
font-weight: var(--thunderid-typography-fontWeight-medium);
|
|
3088
|
+
cursor: pointer;
|
|
3089
|
+
}
|
|
3090
|
+
|
|
3091
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-checkbox")} {
|
|
3092
|
+
cursor: pointer;
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-input")} {
|
|
3096
|
+
box-sizing: border-box;
|
|
3097
|
+
width: 100%;
|
|
3098
|
+
height: var(--thunderid-input-height);
|
|
3099
|
+
padding: 0 var(--thunderid-input-paddingX);
|
|
3100
|
+
border: 1px solid var(--thunderid-input-borderColor);
|
|
3101
|
+
border-radius: var(--thunderid-input-borderRadius);
|
|
3102
|
+
background-color: var(--thunderid-color-background-surface);
|
|
3103
|
+
color: var(--thunderid-color-text-primary);
|
|
3104
|
+
font-family: var(--thunderid-typography-fontFamily);
|
|
3105
|
+
font-size: var(--thunderid-input-fontSize);
|
|
3106
|
+
cursor: pointer;
|
|
3107
|
+
}
|
|
3108
|
+
|
|
3109
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-custom")} {
|
|
3110
|
+
display: flex;
|
|
3111
|
+
align-items: flex-start;
|
|
3112
|
+
gap: calc(var(--thunderid-spacing-unit) * 1.5);
|
|
3113
|
+
}
|
|
3114
|
+
|
|
3115
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-custom")} .${(0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-input")} {
|
|
3116
|
+
cursor: text;
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-custom")} input.${(0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-input")} {
|
|
3120
|
+
flex: 1;
|
|
3121
|
+
min-width: 0;
|
|
3122
|
+
}
|
|
3123
|
+
|
|
3124
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-custom")} select.${(0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-input")} {
|
|
3125
|
+
width: auto;
|
|
3126
|
+
flex: 0 0 auto;
|
|
3127
|
+
cursor: pointer;
|
|
3128
|
+
}
|
|
3129
|
+
|
|
3130
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-input")}:focus {
|
|
3131
|
+
border-color: var(--thunderid-input-focusBorderColor);
|
|
3132
|
+
box-shadow: var(--thunderid-input-focusRing);
|
|
3133
|
+
outline: none;
|
|
3134
|
+
}
|
|
3135
|
+
|
|
3136
|
+
.${(0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-hint")} {
|
|
3137
|
+
color: var(--thunderid-color-text-secondary);
|
|
3138
|
+
font-size: var(--thunderid-typography-fontSize-xs);
|
|
3139
|
+
}
|
|
3067
3140
|
`;
|
|
3068
3141
|
var Consent_css_default = CONSENT_CSS;
|
|
3069
3142
|
|
|
@@ -7975,6 +8048,18 @@ const normalizeFlowResponse = (response, t, options = {}, meta) => {
|
|
|
7975
8048
|
|
|
7976
8049
|
//#endregion
|
|
7977
8050
|
//#region src/components/auth/flow/Consent.ts
|
|
8051
|
+
const VALIDITY_TEXT_DEFAULTS = {
|
|
8052
|
+
custom_label: "Custom validity",
|
|
8053
|
+
custom_unit_label: "Unit",
|
|
8054
|
+
hint_custom: "Enter a whole number.",
|
|
8055
|
+
hint_custom_max: "Enter a whole number, up to {max}.",
|
|
8056
|
+
hint_expires: "Your consent expires in {duration}.",
|
|
8057
|
+
hint_never: "You will not be asked again unless this application asks for more access.",
|
|
8058
|
+
hint_once: "You will be asked again the next time you sign in.",
|
|
8059
|
+
option_custom: "Custom",
|
|
8060
|
+
option_never: "No expiry"
|
|
8061
|
+
};
|
|
8062
|
+
const CUSTOM_OPTION_ID = "custom";
|
|
7978
8063
|
const getConsentOptionalKey = (purposeId, attrName) => `__consent_opt__${purposeId}__${attrName}`;
|
|
7979
8064
|
const isObject = (value) => typeof value === "object" && value !== null;
|
|
7980
8065
|
const toPromptElements = (value) => Array.isArray(value) ? value.filter((element) => isObject(element) && typeof element["name"] === "string") : [];
|
|
@@ -8010,6 +8095,10 @@ const Consent = (0, vue.defineComponent)({
|
|
|
8010
8095
|
required: true,
|
|
8011
8096
|
type: Object
|
|
8012
8097
|
},
|
|
8098
|
+
maxValidityPeriod: {
|
|
8099
|
+
default: void 0,
|
|
8100
|
+
type: Number
|
|
8101
|
+
},
|
|
8013
8102
|
onInputChange: {
|
|
8014
8103
|
required: true,
|
|
8015
8104
|
type: Function
|
|
@@ -8017,9 +8106,14 @@ const Consent = (0, vue.defineComponent)({
|
|
|
8017
8106
|
t: {
|
|
8018
8107
|
default: void 0,
|
|
8019
8108
|
type: Function
|
|
8109
|
+
},
|
|
8110
|
+
validityInput: {
|
|
8111
|
+
default: false,
|
|
8112
|
+
type: Boolean
|
|
8020
8113
|
}
|
|
8021
8114
|
},
|
|
8022
8115
|
setup(props, { slots }) {
|
|
8116
|
+
const i18n = (0, vue.inject)(I18N_KEY, null);
|
|
8023
8117
|
const translate = (key, fallback = "") => {
|
|
8024
8118
|
const value = props.t?.(key);
|
|
8025
8119
|
return value && value !== key ? value : fallback;
|
|
@@ -8043,15 +8137,127 @@ const Consent = (0, vue.defineComponent)({
|
|
|
8043
8137
|
"aria-label": info,
|
|
8044
8138
|
role: "img"
|
|
8045
8139
|
}, [(0, vue.h)(InfoIcon)]) : null].filter((node) => node !== null);
|
|
8140
|
+
const customOpen = (0, vue.ref)(false);
|
|
8141
|
+
const customText = (0, vue.ref)("");
|
|
8142
|
+
const customUnit = (0, vue.ref)((0, __thunderid_browser.getConsentValidityCustomUnits)(props.maxValidityPeriod).includes("minute") ? "minute" : "second");
|
|
8143
|
+
const remembering = (0, vue.ref)((0, __thunderid_browser.getConsentValidityChoices)(props.maxValidityPeriod, props.formValues[__thunderid_browser.CONSENT_VALIDITY_PERIOD_KEY] ?? "").remember);
|
|
8144
|
+
(0, vue.watchEffect)(() => {
|
|
8145
|
+
const value = props.formValues[__thunderid_browser.CONSENT_VALIDITY_PERIOD_KEY] ?? "";
|
|
8146
|
+
const { initial, once } = (0, __thunderid_browser.getConsentValidityChoices)(props.maxValidityPeriod, value);
|
|
8147
|
+
if (props.validityInput && once && value === "") props.onInputChange(__thunderid_browser.CONSENT_VALIDITY_PERIOD_KEY, initial.value);
|
|
8148
|
+
}, { flush: "post" });
|
|
8149
|
+
const validityField = () => {
|
|
8150
|
+
const value = props.formValues[__thunderid_browser.CONSENT_VALIDITY_PERIOD_KEY] ?? "";
|
|
8151
|
+
const { initial, once, remember, remembered, selected } = (0, __thunderid_browser.getConsentValidityChoices)(props.maxValidityPeriod, value, remembering.value);
|
|
8152
|
+
if (!once) return null;
|
|
8153
|
+
const text = (key, params) => (0, __thunderid_browser.substituteTranslationParams)(translate(`consent.validity_period.${key}`, VALIDITY_TEXT_DEFAULTS[key]), params);
|
|
8154
|
+
const textOf = (option) => (0, __thunderid_browser.getConsentValidityOptionText)(option, text, i18n?.currentLanguage.value);
|
|
8155
|
+
const custom = remember && (customOpen.value || selected === void 0);
|
|
8156
|
+
const units = (0, __thunderid_browser.getConsentValidityCustomUnits)(props.maxValidityPeriod);
|
|
8157
|
+
const prefilled = custom && !customOpen.value && Number.isFinite(Number(value)) ? (0, __thunderid_browser.splitConsentValidityPeriod)(Number(value), units) : void 0;
|
|
8158
|
+
const unit = prefilled?.unit ?? customUnit.value;
|
|
8159
|
+
const amount = customOpen.value ? customText.value : prefilled?.amount ?? "";
|
|
8160
|
+
const maxAmount = (0, __thunderid_browser.getConsentValidityCustomMax)(props.maxValidityPeriod, unit);
|
|
8161
|
+
const handleSelectChange = (event) => {
|
|
8162
|
+
const chosen = event.target.value;
|
|
8163
|
+
if (chosen === CUSTOM_OPTION_ID) {
|
|
8164
|
+
const current = selected?.kind === "period" ? (0, __thunderid_browser.splitConsentValidityPeriod)(selected.seconds, units) : void 0;
|
|
8165
|
+
customOpen.value = true;
|
|
8166
|
+
customText.value = current?.amount ?? "";
|
|
8167
|
+
customUnit.value = current?.unit ?? customUnit.value;
|
|
8168
|
+
props.onInputChange(__thunderid_browser.CONSENT_VALIDITY_PERIOD_KEY, selected?.kind === "period" ? selected.value : initial.value);
|
|
8169
|
+
return;
|
|
8170
|
+
}
|
|
8171
|
+
const picked = remembered.find((option) => option.id === chosen);
|
|
8172
|
+
if (picked) {
|
|
8173
|
+
customOpen.value = false;
|
|
8174
|
+
props.onInputChange(__thunderid_browser.CONSENT_VALIDITY_PERIOD_KEY, picked.value);
|
|
8175
|
+
}
|
|
8176
|
+
};
|
|
8177
|
+
const applyCustom = (digits, nextUnit) => {
|
|
8178
|
+
const period = (0, __thunderid_browser.getConsentValidityCustomPeriod)(digits, props.maxValidityPeriod, nextUnit);
|
|
8179
|
+
customOpen.value = true;
|
|
8180
|
+
customUnit.value = nextUnit;
|
|
8181
|
+
customText.value = period.amount === "" ? digits : period.amount;
|
|
8182
|
+
props.onInputChange(__thunderid_browser.CONSENT_VALIDITY_PERIOD_KEY, period.seconds === "" ? initial.value : period.seconds);
|
|
8183
|
+
return period;
|
|
8184
|
+
};
|
|
8185
|
+
const handleCustomInput = (event) => {
|
|
8186
|
+
const field = event.target;
|
|
8187
|
+
applyCustom(field.value.replace(/\D/g, ""), unit);
|
|
8188
|
+
field.value = customText.value;
|
|
8189
|
+
};
|
|
8190
|
+
const handleUnitChange = (event) => {
|
|
8191
|
+
applyCustom(amount, event.target.value);
|
|
8192
|
+
};
|
|
8193
|
+
const hint = (0, vue.h)("span", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-hint") }, custom ? maxAmount === void 0 ? text("hint_custom") : text("hint_custom_max", { max: String(maxAmount) }) : textOf(selected ?? once).hint);
|
|
8194
|
+
const group = (...nodes) => (0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-group") }, nodes);
|
|
8195
|
+
return (0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity") }, [
|
|
8196
|
+
group((0, vue.h)("label", {
|
|
8197
|
+
class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-remember"),
|
|
8198
|
+
for: "consent_validity_remember"
|
|
8199
|
+
}, [(0, vue.h)("input", {
|
|
8200
|
+
checked: remember,
|
|
8201
|
+
class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-checkbox"),
|
|
8202
|
+
id: "consent_validity_remember",
|
|
8203
|
+
onChange: (event) => {
|
|
8204
|
+
const checked = event.target.checked;
|
|
8205
|
+
remembering.value = checked;
|
|
8206
|
+
customOpen.value = false;
|
|
8207
|
+
customText.value = "";
|
|
8208
|
+
props.onInputChange(__thunderid_browser.CONSENT_ONE_TIME_KEY, checked ? "false" : "true");
|
|
8209
|
+
props.onInputChange(__thunderid_browser.CONSENT_VALIDITY_PERIOD_KEY, checked ? initial.value : once.value);
|
|
8210
|
+
},
|
|
8211
|
+
type: "checkbox"
|
|
8212
|
+
}), translate("consent.validity_period.remember", "Remember my decision")]), remember ? null : hint),
|
|
8213
|
+
...remember ? [group((0, vue.h)("select", {
|
|
8214
|
+
"aria-label": translate("consent.validity_period.label", "Ask me again"),
|
|
8215
|
+
class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-input"),
|
|
8216
|
+
id: "consent_validity_period",
|
|
8217
|
+
onChange: handleSelectChange,
|
|
8218
|
+
value: custom ? CUSTOM_OPTION_ID : selected?.id
|
|
8219
|
+
}, [...remembered.map((option) => (0, vue.h)("option", {
|
|
8220
|
+
key: option.id,
|
|
8221
|
+
selected: !custom && option.id === selected?.id,
|
|
8222
|
+
value: option.id
|
|
8223
|
+
}, textOf(option).label)), (0, vue.h)("option", {
|
|
8224
|
+
key: CUSTOM_OPTION_ID,
|
|
8225
|
+
selected: custom,
|
|
8226
|
+
value: CUSTOM_OPTION_ID
|
|
8227
|
+
}, text("option_custom"))]), custom ? null : hint)] : [],
|
|
8228
|
+
...custom ? [group((0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-custom") }, [(0, vue.h)("input", {
|
|
8229
|
+
"aria-label": text("custom_label"),
|
|
8230
|
+
class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-input"),
|
|
8231
|
+
id: "consent_validity_custom",
|
|
8232
|
+
inputmode: "numeric",
|
|
8233
|
+
onInput: handleCustomInput,
|
|
8234
|
+
pattern: "[0-9]*",
|
|
8235
|
+
type: "text",
|
|
8236
|
+
value: amount
|
|
8237
|
+
}), (0, vue.h)("select", {
|
|
8238
|
+
"aria-label": text("custom_unit_label"),
|
|
8239
|
+
class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__validity-input"),
|
|
8240
|
+
id: "consent_validity_unit",
|
|
8241
|
+
onChange: handleUnitChange,
|
|
8242
|
+
value: unit
|
|
8243
|
+
}, units.map((option) => (0, vue.h)("option", {
|
|
8244
|
+
key: option,
|
|
8245
|
+
selected: option === unit,
|
|
8246
|
+
value: option
|
|
8247
|
+
}, (0, __thunderid_browser.getConsentValidityUnitLabel)(option, i18n?.currentLanguage.value))))]), hint)] : []
|
|
8248
|
+
]);
|
|
8249
|
+
};
|
|
8046
8250
|
return () => {
|
|
8047
8251
|
const purposes = parsePurposes(props.consentData);
|
|
8048
8252
|
if (purposes.length === 0) return null;
|
|
8049
8253
|
if (slots["default"]) return (0, vue.h)("div", slots["default"]({
|
|
8050
8254
|
formValues: props.formValues,
|
|
8255
|
+
maxValidityPeriod: props.maxValidityPeriod,
|
|
8051
8256
|
onInputChange: props.onInputChange,
|
|
8052
|
-
purposes
|
|
8257
|
+
purposes,
|
|
8258
|
+
validityInput: props.validityInput
|
|
8053
8259
|
}));
|
|
8054
|
-
return (0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent") }, purposes.map((purpose) => {
|
|
8260
|
+
return (0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent") }, [...purposes.map((purpose) => {
|
|
8055
8261
|
const permission = purpose.type === "permissions";
|
|
8056
8262
|
const optionalName = permission ? translate("consent.optional_scope", "Optional Permissions") : translate("consent.optional_claims", "Optional Attributes");
|
|
8057
8263
|
const essentialName = permission ? translate("consent.essential_scope", "Essential Permissions") : translate("consent.essential_claims", "Essential Attributes");
|
|
@@ -8096,7 +8302,7 @@ const Consent = (0, vue.defineComponent)({
|
|
|
8096
8302
|
class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__purpose"),
|
|
8097
8303
|
key: purpose.purposeId
|
|
8098
8304
|
}, [purpose.essential.length > 0 ? (0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__section") }, [(0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__header") }, sectionTitle(essentialName, translate(permission ? "consent.essential_scope.info" : "consent.essential_claims.info", permission ? "" : "These attributes are required for the service to function properly."))), itemList(purpose.essential, true)]) : null, purpose.optional.length > 0 ? (0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__section") }, [(0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__optional-header") }, [(0, vue.h)("div", { class: (0, __thunderid_browser.withVendorCSSClassPrefix)("consent__header") }, sectionTitle(optionalName, translate(permission ? "consent.optional_scope.info" : "consent.optional_claims.info", permission ? "" : "These attributes are optional and can be provided at your discretion."))), toggle(`consent_opt_${purpose.purposeId}_all`, allSelected, optionalName, (checked) => purpose.optional.forEach((element) => props.onInputChange(getConsentOptionalKey(purpose.purposeId, element.name), checked ? "true" : "false")))]), branches.length > 0 ? branchList(branches) : itemList(purpose.optional, false)]) : null]);
|
|
8099
|
-
}));
|
|
8305
|
+
}), props.validityInput ? validityField() : null]);
|
|
8100
8306
|
};
|
|
8101
8307
|
}
|
|
8102
8308
|
});
|
|
@@ -9024,9 +9230,13 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
|
|
|
9024
9230
|
const consentPrompt = options.additionalData?.["consentPrompt"];
|
|
9025
9231
|
if (consentPrompt && eventType.toUpperCase() === __thunderid_browser.EmbeddedFlowEventType.Submit) {
|
|
9026
9232
|
const isDeny = componentVariant.toLowerCase() !== "primary";
|
|
9233
|
+
const oneTime = !isDeny && (0, __thunderid_browser.getConsentOneTime)(formValues);
|
|
9234
|
+
const validityPeriod = isDeny || oneTime ? void 0 : (0, __thunderid_browser.getConsentValidityPeriod)(formValues);
|
|
9027
9235
|
const decisions = {
|
|
9028
9236
|
approved: !isDeny,
|
|
9029
9237
|
...isDeny ? { reason: __thunderid_browser.ConsentConstants.REASON_USER_DENIED } : {},
|
|
9238
|
+
...validityPeriod === void 0 ? {} : { validityPeriod },
|
|
9239
|
+
...oneTime ? { oneTime } : {},
|
|
9030
9240
|
purposes: consentPrompt.purposes.map((p) => ({
|
|
9031
9241
|
approved: !isDeny,
|
|
9032
9242
|
elements: [...(p.essential ?? []).map((e) => ({
|
|
@@ -9232,13 +9442,18 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
|
|
|
9232
9442
|
style: stackStyle
|
|
9233
9443
|
}, stackChildren.filter(Boolean));
|
|
9234
9444
|
}
|
|
9235
|
-
case __thunderid_browser.EmbeddedFlowComponentType.Consent:
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9445
|
+
case __thunderid_browser.EmbeddedFlowComponentType.Consent: {
|
|
9446
|
+
const { enabled: validityInput, maxValidityPeriod } = (0, __thunderid_browser.getConsentValidityInput)(options.additionalData);
|
|
9447
|
+
return (0, vue.h)(Consent_default, {
|
|
9448
|
+
consentData: options.additionalData?.["consentPrompt"],
|
|
9449
|
+
formValues,
|
|
9450
|
+
key,
|
|
9451
|
+
maxValidityPeriod,
|
|
9452
|
+
onInputChange,
|
|
9453
|
+
t: options.t,
|
|
9454
|
+
validityInput
|
|
9455
|
+
});
|
|
9456
|
+
}
|
|
9242
9457
|
case __thunderid_browser.EmbeddedFlowComponentType.Timer: {
|
|
9243
9458
|
const textTemplate = resolve(component.label) || "Time remaining: {time}";
|
|
9244
9459
|
const timeoutMs = Number(options.additionalData?.["stepTimeout"]) || 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthOptionFactoryCore.d.ts","sourceRoot":"","sources":["../../../../src/components/auth/flow/AuthOptionFactoryCore.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,oBAAoB,EACpB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"AuthOptionFactoryCore.d.ts","sourceRoot":"","sources":["../../../../src/components/auth/flow/AuthOptionFactoryCore.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Consent.css.d.ts","sourceRoot":"","sources":["../../../../src/components/auth/flow/Consent.css.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Consent.css.d.ts","sourceRoot":"","sources":["../../../../src/components/auth/flow/Consent.css.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,WAAW,QAuNhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -5,14 +5,18 @@ export type ConsentData = string | ConsentPurposeData[] | {
|
|
|
5
5
|
};
|
|
6
6
|
export interface ConsentRenderProps {
|
|
7
7
|
formValues: Record<string, string>;
|
|
8
|
+
maxValidityPeriod?: number;
|
|
8
9
|
onInputChange: (name: string, value: string) => void;
|
|
9
10
|
purposes: ConsentPurposeData[];
|
|
11
|
+
validityInput: boolean;
|
|
10
12
|
}
|
|
11
13
|
export interface ConsentProps {
|
|
12
14
|
consentData?: ConsentData;
|
|
13
15
|
formValues: Record<string, string>;
|
|
16
|
+
maxValidityPeriod?: number;
|
|
14
17
|
onInputChange: (name: string, value: string) => void;
|
|
15
18
|
t?: (key: string) => string;
|
|
19
|
+
validityInput?: boolean;
|
|
16
20
|
}
|
|
17
21
|
export declare const getConsentOptionalKey: (purposeId: string, attrName: string) => string;
|
|
18
22
|
declare const Consent: Component;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Consent.d.ts","sourceRoot":"","sources":["../../../../src/components/auth/flow/Consent.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"Consent.d.ts","sourceRoot":"","sources":["../../../../src/components/auth/flow/Consent.ts"],"names":[],"mappings":"AAGA,OAAO,EAKL,KAAK,kBAAkB,EAiBxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,SAAS,EASf,MAAM,KAAK,CAAC;AAKb,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,kBAAkB,EAAE,GAAG;IAAC,QAAQ,EAAE,kBAAkB,EAAE,CAAA;CAAC,CAAC;AAgB3F,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,eAAO,MAAM,qBAAqB,GAAI,WAAW,MAAM,EAAE,UAAU,MAAM,KAAG,MAChC,CAAC;AA+C7C,QAAA,MAAM,OAAO,EAAE,SAgZb,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ADMINISTRATION_FLOW_TYPE, APPLICATION_GRANT_TYPES, AccountLifecycleFlowConfigKey, AccountLifecycleFlowConfigKey as AccountLifecycleFlowConfigKey$1, AdministrationFlowConfigKey, AdministrationFlowConfigKey as AdministrationFlowConfigKey$1, AdministrationFlowData, AdministrationFlowError, AdministrationFlowInput, AdministrationModes, AgentQueryKeys, AgentQueryKeys as AgentQueryKeys$1, ApplicationQueryKeys, ApplicationQueryKeys as ApplicationQueryKeys$1, AttributeVerificationConstants, AttributeVerificationConstants as AttributeVerificationConstants$1, AuthFlowSelectConstants, ConsentConstants, CredentialConstants, DEFAULT_APPLICATION_GRANT_TYPES, DEFAULT_THEME, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowComponentType as EmbeddedFlowComponentType$1, EmbeddedFlowEventType, EmbeddedFlowEventType as EmbeddedFlowEventType$1, EmbeddedFlowResponseType, EmbeddedFlowTextVariant, EmbeddedFlowType, EmbeddedSelfFlowStatus, EmbeddedSelfFlowStatus as EmbeddedSelfFlowStatus$1, EmbeddedSignInFlowStatus, EmbeddedSignInFlowStatus as EmbeddedSignInFlowStatus$1, EmbeddedSignInFlowType, EmbeddedSignInFlowType as EmbeddedSignInFlowType$1, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowStatus as EmbeddedSignUpFlowStatus$1, EmbeddedSignUpFlowType, FetchHttpClient, FieldType, FieldType as FieldType$1, FlowMetaType, GroupQueryKeys, GroupQueryKeys as GroupQueryKeys$1, ORGANIZATION_UNIT_ERROR_KEYS, OrganizationUnitQueryKeys, OrganizationUnitSwitchErrorCodes, OrganizationUnitSwitchErrorCodes as OrganizationUnitSwitchErrorCodes$1, PROJECT_ERROR_KEYS, ProjectQueryKeys, RoleQueryKeys, RoleQueryKeys as RoleQueryKeys$1, SHARING_POLICY_ERROR_KEYS, SHARING_RESOURCE_COLLECTIONS, SPAUtils, SelectConstants, SharingPolicyQueryKeys, ThunderIDAPIError, ThunderIDAPIError as ThunderIDAPIError$1, ThunderIDBrowserClient, ThunderIDError, ThunderIDRuntimeError, ThunderIDRuntimeError as ThunderIDRuntimeError$1, ThunderIDWordmark, TranslationBundleConstants, UserQueryKeys, UserQueryKeys as UserQueryKeys$1, UserSelectConstants, UserTypeSelectConstants, addGroupMembers, addGroupMembers as addGroupMembers$1, addRoleAssignments, addRoleAssignments as addRoleAssignments$1, applyGatewayConfiguration, arrayBufferToBase64url, base64urlToArrayBuffer, bem, buildValidatorFromRules, compileConsentDecisions, copyTextToClipboard, createAction, createAgent, createAgent as createAgent$1, createAgentType, createApplication, createApplication as createApplication$1, createApplicationSharingPolicy, createAuthorizationDetailType, createClassObserver, createClassObserver as createClassObserver$1, createConfigurationVersion, createConnection, createCredentialConfiguration, createDesignTheme, createFlow, createFlowSharingPolicy, createGateway, createGatewaySecret, createGatewayVariable, createGroup, createGroup as createGroup$1, createGroupByPath, createHttpClientFetcher, createLayout, createMediaQueryListener, createMediaQueryListener as createMediaQueryListener$1, createNotificationTemplate, createOrganizationUnit, createOrganizationUnit as createOrganizationUnit$1, createPackageComponentLogger, createPackageLogger, createPresentationDefinition, createProject, createProject as createProject$1, createResource, createResourceInvalidator, createResourceInvalidator as createResourceInvalidator$1, createResourceOptionsLoader, createResourceServer, createRole, createRole as createRole$1, createRoleSharingPolicy, createSecret, createTheme, createUser, createUser as createUser$1, createUserByPath, createUserSharingPolicy, createUserType, createVariable, deepMerge, deleteAction, deleteAgent, deleteAgent as deleteAgent$1, deleteAgentType, deleteApplication, deleteApplication as deleteApplication$1, deleteApplicationSharingPolicy, deleteAuthorizationDetailType, deleteClientRegistration, deleteConnection, deleteCredentialConfiguration, deleteDesignTheme, deleteFlow, deleteFlowSharingPolicy, deleteGateway, deleteGatewaySecret, deleteGatewayVariable, deleteGroup, deleteGroup as deleteGroup$1, deleteImportedConfiguration, deleteLayout, deleteNotificationTemplate, deleteOrganizationUnit, deleteOrganizationUnit as deleteOrganizationUnit$1, deleteOrganizationUnitByPath, deletePresentationDefinition, deleteProject, deleteProject as deleteProject$1, deleteResource, deleteResourceServer, deleteRole, deleteRole as deleteRole$1, deleteRoleSharingPolicy, deleteSecret, deleteTranslation, deleteTranslations, deleteUser, deleteUser as deleteUser$1, deleteUserSharingPolicy, deleteUserType, deleteVariable, describeSharingPolicyScope, detectThemeMode, detectThemeMode as detectThemeMode$1, evaluateChangePasswordForm, executeAdministrationFlow, executeEmbeddedDeviceGrantFlow, executeEmbeddedSelfFlow, executeEmbeddedSignInFlow, executeEmbeddedSignUpFlow, exportConfiguration, extractEmojiFromUri, extractUserClaimsFromIdToken, fallbackResourceInvalidator, findAdministrationFlows, generateFlattenedUserProfile, get, getAccessibleOrganizationUnits, getAccountLifecycleActions, getAccountLifecycleActions as getAccountLifecycleActions$1, getAction, getActions, getActiveTheme, getAgent, getAgent as getAgent$1, getAgentGroups, getAgentGroups as getAgentGroups$1, getAgentName, getAgentName as getAgentName$1, getAgentRoles, getAgentRoles as getAgentRoles$1, getAgentType, getAgentTypes, getAgentTypes as getAgentTypes$1, getAgents, getAgents as getAgents$1, getApplication, getApplication as getApplication$1, getApplicationClientSecret, getApplicationOAuthConfig, getApplicationOverlayRules, getApplicationSharingPolicies, getApplicationSharingPolicy, getApplications, getApplications as getApplications$1, getAuthorizationDetailType, getAuthorizationDetailTypes, getClientRegistration, getConfigurationVersion, getConfigurationVersions, getConnection, getConnectionUsages, getConnections, getConnectionsMeta, getConsentElementDecision, getConsentPermissionBranches, getConsentPermissionBranches as getConsentPermissionBranches$1, getCredentialConfiguration, getCredentialConfigurations, getDefaultI18nBundles, getDesignTheme, getDesignThemeUsages, getDesignThemes, getFlow, getFlowMeta, getFlowOverlayRules, getFlowSharingPolicies, getFlowSharingPolicy, getFlowStepComponents, getFlowUsages, getFlowVariables, getFlowVersion, getFlowVersions, getFlows, getFlows as getFlows$1, getGateway, getGatewayAppliedConfiguration, getGatewayAppliedVersion, getGatewayConfigurationDiff, getGatewayMaster, getGatewayMasterHistory, getGatewayMasterResource, getGatewaySecret, getGatewaySecrets, getGatewayVariable, getGatewayVariables, getGateways, getGroup, getGroup as getGroup$1, getGroupMembers, getGroupMembers as getGroupMembers$1, getGroups, getGroups as getGroups$1, getGroupsByPath, getLanguages, getLayout, getLayoutUsages, getLayouts, getNotificationTemplate, getNotificationTemplates, getOrganizationUnit, getOrganizationUnit as getOrganizationUnit$1, getOrganizationUnitByPath, getOrganizationUnitChildren, getOrganizationUnitChildren as getOrganizationUnitChildren$1, getOrganizationUnitGroups, getOrganizationUnitGroups as getOrganizationUnitGroups$1, getOrganizationUnitRoles, getOrganizationUnitRoles as getOrganizationUnitRoles$1, getOrganizationUnitUsers, getOrganizationUnitUsers as getOrganizationUnitUsers$1, getOrganizationUnits, getOrganizationUnits as getOrganizationUnits$1, getPresentationDefinition, getPresentationDefinitions, getProject, getProject as getProject$1, getProjects, getProjects as getProjects$1, getResource, getResourceServer, getResourceServerPermissions, getResourceServerPermissions as getResourceServerPermissions$1, getResourceServers, getResourceServers as getResourceServers$1, getResources, getRole, getRole as getRole$1, getRoleAssignments, getRoleAssignments as getRoleAssignments$1, getRoleOverlayRules, getRoleSharingPolicies, getRoleSharingPolicy, getRoles, getRoles as getRoles$1, getSecret, getSecrets, getSelectMessages, getServerConfig, getServerConfigs, getSharingPolicyOperations, getSupportedAuthorizationDetailsType, getSupportedAuthorizationDetailsTypes, getTokenPermissions, getUser, getUser as getUser$1, getUserGroups, getUserGroups as getUserGroups$1, getUserOverlayRules, getUserSharingPolicies, getUserSharingPolicy, getUserType, getUserTypeByHandle, getUserTypes, getUserTypes as getUserTypes$1, getUserUsages, getUsers, getUsers as getUsers$1, getUsersByPath, getUsersMe, getUsersMeMeta, getVariable, getVariables, getVendorPrefix, getVerifiedAttributes, getVerifiedAttributes as getVerifiedAttributes$1, handleWebAuthnAuthentication, hasAdminVerificationStatus, hasAuthParamsInUrl, hasAuthParamsInUrl as hasAuthParamsInUrl$1, hasCalledForThisInstanceInUrl, hasPermission, hasPermission as hasPermission$1, hasUnresolvedTranslationParams, http, importConfiguration, isAdminVerifiableAttribute, isApplicationSubmissionValid, isEmojiUri, isEmpty, isFlowExpiredError, isFlowMetaUnavailableError, isSharingPolicyFormValid, isVerifiableAttribute, isVerifiableAttribute as isVerifiableAttribute$1, loadUntilOptionsGrow, mapCredentialUpdateError, mergeOptionsBatch, navigate, navigate as navigate$1, normalizeBorderRadius, normalizeSelectOptions, normalizeTranslations, parseKeyValuePairs, parseKeyValuePairs as parseKeyValuePairs$1, parseRedirectUris, previewCimdDocument, readCurrentProject, regenerateAgentSecret, regenerateClientSecret, regenerateClientSecret as regenerateClientSecret$1, regenerateFlowSecret, registerClient, removeGroupMembers, removeGroupMembers as removeGroupMembers$1, removeRoleAssignments, removeRoleAssignments as removeRoleAssignments$1, resolveAdministrationFlowHandles, resolveAdministrationFlowHandles as resolveAdministrationFlowHandles$1, resolveAdministrationFlowId, resolveAdministrationFlows, resolveAdministrationFlows as resolveAdministrationFlows$1, resolveChangeCredentialPolicy, resolveDesign, resolveFlowTemplateLiterals, resolveLogoUri, resolveManagedIdentityName, resolvePageSize, resolveRequestBaseUrl, resolveResourceEndpoint, resolveTranslation, resolveTranslations, restoreFlowVersion, revertGatewayConfiguration, runAccountLifecycleAction, runAccountLifecycleAction as runAccountLifecycleAction$1, runAdministrationFlow, sendUserAttributeVerification, sendUserAttributeVerification as sendUserAttributeVerification$1, setTranslation, setTranslations, startCase, substituteTranslationParams, supportsCredential, suspendAgent, suspendApplication, suspendUser, toAuthFlowSelectPage, toCreateApplicationRequest, toEqualityFilter, toError, toManagementErrorMessage, toSharingPolicyFormValues, toSharingPolicyRequest, toSharingPolicyUpdateRequest, toUpdateApplicationRequest, toUserSelectPage, toUserTypeSelectPage, unlockAgent, unlockUser, unsuspendAgent, unsuspendApplication, unsuspendUser, updateAction, updateAgent, updateAgentType, updateApplication, updateApplication as updateApplication$1, updateApplicationSharingPolicy, updateAuthorizationDetailType, updateClientRegistration, updateConnection, updateCredentialConfiguration, updateDesignTheme, updateFlow, updateFlowSharingPolicy, updateFlowVariables, updateGateway, updateGatewaySecret, updateGatewayVariable, updateGroup, updateLayout, updateMeCredentials, updateMeProfile, updateNotificationTemplate, updateOrganizationUnit, updateOrganizationUnit as updateOrganizationUnit$1, updateOrganizationUnitByPath, updatePresentationDefinition, updateProject, updateProject as updateProject$1, updateResource, updateResourceServer, updateRole, updateRole as updateRole$1, updateRoleSharingPolicy, updateSecret, updateServerConfig, updateUser, updateUser as updateUser$1, updateUserCredentials, updateUserSharingPolicy, updateUserType, updateVariable, withVendorCSSClassPrefix, writeCurrentProject } from "@thunderid/browser";
|
|
2
|
-
import { Comment, Fragment, Teleport, cloneVNode, computed, defineComponent, getCurrentInstance, getCurrentScope, h, inject, isVNode, nextTick, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, provide, readonly, ref, shallowReadonly, shallowRef, toValue, useId, watch } from "vue";
|
|
1
|
+
import { ADMINISTRATION_FLOW_TYPE, APPLICATION_GRANT_TYPES, AccountLifecycleFlowConfigKey, AccountLifecycleFlowConfigKey as AccountLifecycleFlowConfigKey$1, AdministrationFlowConfigKey, AdministrationFlowConfigKey as AdministrationFlowConfigKey$1, AdministrationFlowData, AdministrationFlowError, AdministrationFlowInput, AdministrationModes, AgentQueryKeys, AgentQueryKeys as AgentQueryKeys$1, ApplicationQueryKeys, ApplicationQueryKeys as ApplicationQueryKeys$1, AttributeVerificationConstants, AttributeVerificationConstants as AttributeVerificationConstants$1, AuthFlowSelectConstants, CONSENT_ONE_TIME_KEY, CONSENT_VALIDITY_PERIOD_KEY, ConsentConstants, CredentialConstants, DEFAULT_APPLICATION_GRANT_TYPES, DEFAULT_THEME, EmbeddedFlowActionVariant, EmbeddedFlowComponentType, EmbeddedFlowComponentType as EmbeddedFlowComponentType$1, EmbeddedFlowEventType, EmbeddedFlowEventType as EmbeddedFlowEventType$1, EmbeddedFlowResponseType, EmbeddedFlowTextVariant, EmbeddedFlowType, EmbeddedSelfFlowStatus, EmbeddedSelfFlowStatus as EmbeddedSelfFlowStatus$1, EmbeddedSignInFlowStatus, EmbeddedSignInFlowStatus as EmbeddedSignInFlowStatus$1, EmbeddedSignInFlowType, EmbeddedSignInFlowType as EmbeddedSignInFlowType$1, EmbeddedSignUpFlowStatus, EmbeddedSignUpFlowStatus as EmbeddedSignUpFlowStatus$1, EmbeddedSignUpFlowType, FetchHttpClient, FieldType, FieldType as FieldType$1, FlowMetaType, GroupQueryKeys, GroupQueryKeys as GroupQueryKeys$1, ORGANIZATION_UNIT_ERROR_KEYS, OrganizationUnitQueryKeys, OrganizationUnitSwitchErrorCodes, OrganizationUnitSwitchErrorCodes as OrganizationUnitSwitchErrorCodes$1, PROJECT_ERROR_KEYS, ProjectQueryKeys, RoleQueryKeys, RoleQueryKeys as RoleQueryKeys$1, SHARING_POLICY_ERROR_KEYS, SHARING_RESOURCE_COLLECTIONS, SPAUtils, SelectConstants, SharingPolicyQueryKeys, ThunderIDAPIError, ThunderIDAPIError as ThunderIDAPIError$1, ThunderIDBrowserClient, ThunderIDError, ThunderIDRuntimeError, ThunderIDRuntimeError as ThunderIDRuntimeError$1, ThunderIDWordmark, TranslationBundleConstants, UserQueryKeys, UserQueryKeys as UserQueryKeys$1, UserSelectConstants, UserTypeSelectConstants, addGroupMembers, addGroupMembers as addGroupMembers$1, addRoleAssignments, addRoleAssignments as addRoleAssignments$1, applyGatewayConfiguration, arrayBufferToBase64url, base64urlToArrayBuffer, bem, buildValidatorFromRules, compileConsentDecisions, copyTextToClipboard, createAction, createAgent, createAgent as createAgent$1, createAgentType, createApplication, createApplication as createApplication$1, createApplicationSharingPolicy, createAuthorizationDetailType, createClassObserver, createClassObserver as createClassObserver$1, createConfigurationVersion, createConnection, createCredentialConfiguration, createDesignTheme, createFlow, createFlowSharingPolicy, createGateway, createGatewaySecret, createGatewayVariable, createGroup, createGroup as createGroup$1, createGroupByPath, createHttpClientFetcher, createLayout, createMediaQueryListener, createMediaQueryListener as createMediaQueryListener$1, createNotificationTemplate, createOrganizationUnit, createOrganizationUnit as createOrganizationUnit$1, createPackageComponentLogger, createPackageLogger, createPresentationDefinition, createProject, createProject as createProject$1, createResource, createResourceInvalidator, createResourceInvalidator as createResourceInvalidator$1, createResourceOptionsLoader, createResourceServer, createRole, createRole as createRole$1, createRoleSharingPolicy, createSecret, createTheme, createUser, createUser as createUser$1, createUserByPath, createUserSharingPolicy, createUserType, createVariable, deepMerge, deleteAction, deleteAgent, deleteAgent as deleteAgent$1, deleteAgentType, deleteApplication, deleteApplication as deleteApplication$1, deleteApplicationSharingPolicy, deleteAuthorizationDetailType, deleteClientRegistration, deleteConnection, deleteCredentialConfiguration, deleteDesignTheme, deleteFlow, deleteFlowSharingPolicy, deleteGateway, deleteGatewaySecret, deleteGatewayVariable, deleteGroup, deleteGroup as deleteGroup$1, deleteImportedConfiguration, deleteLayout, deleteNotificationTemplate, deleteOrganizationUnit, deleteOrganizationUnit as deleteOrganizationUnit$1, deleteOrganizationUnitByPath, deletePresentationDefinition, deleteProject, deleteProject as deleteProject$1, deleteResource, deleteResourceServer, deleteRole, deleteRole as deleteRole$1, deleteRoleSharingPolicy, deleteSecret, deleteTranslation, deleteTranslations, deleteUser, deleteUser as deleteUser$1, deleteUserSharingPolicy, deleteUserType, deleteVariable, describeSharingPolicyScope, detectThemeMode, detectThemeMode as detectThemeMode$1, evaluateChangePasswordForm, executeAdministrationFlow, executeEmbeddedDeviceGrantFlow, executeEmbeddedSelfFlow, executeEmbeddedSignInFlow, executeEmbeddedSignUpFlow, exportConfiguration, extractEmojiFromUri, extractUserClaimsFromIdToken, fallbackResourceInvalidator, findAdministrationFlows, generateFlattenedUserProfile, get, getAccessibleOrganizationUnits, getAccountLifecycleActions, getAccountLifecycleActions as getAccountLifecycleActions$1, getAction, getActions, getActiveTheme, getAgent, getAgent as getAgent$1, getAgentGroups, getAgentGroups as getAgentGroups$1, getAgentName, getAgentName as getAgentName$1, getAgentRoles, getAgentRoles as getAgentRoles$1, getAgentType, getAgentTypes, getAgentTypes as getAgentTypes$1, getAgents, getAgents as getAgents$1, getApplication, getApplication as getApplication$1, getApplicationClientSecret, getApplicationOAuthConfig, getApplicationOverlayRules, getApplicationSharingPolicies, getApplicationSharingPolicy, getApplications, getApplications as getApplications$1, getAuthorizationDetailType, getAuthorizationDetailTypes, getClientRegistration, getConfigurationVersion, getConfigurationVersions, getConnection, getConnectionUsages, getConnections, getConnectionsMeta, getConsentElementDecision, getConsentOneTime, getConsentPermissionBranches, getConsentPermissionBranches as getConsentPermissionBranches$1, getConsentValidityChoices, getConsentValidityCustomMax, getConsentValidityCustomPeriod, getConsentValidityCustomUnits, getConsentValidityInput, getConsentValidityOptionText, getConsentValidityPeriod, getConsentValidityUnitLabel, getCredentialConfiguration, getCredentialConfigurations, getDefaultI18nBundles, getDesignTheme, getDesignThemeUsages, getDesignThemes, getFlow, getFlowMeta, getFlowOverlayRules, getFlowSharingPolicies, getFlowSharingPolicy, getFlowStepComponents, getFlowUsages, getFlowVariables, getFlowVersion, getFlowVersions, getFlows, getFlows as getFlows$1, getGateway, getGatewayAppliedConfiguration, getGatewayAppliedVersion, getGatewayConfigurationDiff, getGatewayMaster, getGatewayMasterHistory, getGatewayMasterResource, getGatewaySecret, getGatewaySecrets, getGatewayVariable, getGatewayVariables, getGateways, getGroup, getGroup as getGroup$1, getGroupMembers, getGroupMembers as getGroupMembers$1, getGroups, getGroups as getGroups$1, getGroupsByPath, getLanguages, getLayout, getLayoutUsages, getLayouts, getNotificationTemplate, getNotificationTemplates, getOrganizationUnit, getOrganizationUnit as getOrganizationUnit$1, getOrganizationUnitByPath, getOrganizationUnitChildren, getOrganizationUnitChildren as getOrganizationUnitChildren$1, getOrganizationUnitGroups, getOrganizationUnitGroups as getOrganizationUnitGroups$1, getOrganizationUnitRoles, getOrganizationUnitRoles as getOrganizationUnitRoles$1, getOrganizationUnitUsers, getOrganizationUnitUsers as getOrganizationUnitUsers$1, getOrganizationUnits, getOrganizationUnits as getOrganizationUnits$1, getPresentationDefinition, getPresentationDefinitions, getProject, getProject as getProject$1, getProjects, getProjects as getProjects$1, getResource, getResourceServer, getResourceServerPermissions, getResourceServerPermissions as getResourceServerPermissions$1, getResourceServers, getResourceServers as getResourceServers$1, getResources, getRole, getRole as getRole$1, getRoleAssignments, getRoleAssignments as getRoleAssignments$1, getRoleOverlayRules, getRoleSharingPolicies, getRoleSharingPolicy, getRoles, getRoles as getRoles$1, getSecret, getSecrets, getSelectMessages, getServerConfig, getServerConfigs, getSharingPolicyOperations, getSupportedAuthorizationDetailsType, getSupportedAuthorizationDetailsTypes, getTokenPermissions, getUser, getUser as getUser$1, getUserGroups, getUserGroups as getUserGroups$1, getUserOverlayRules, getUserSharingPolicies, getUserSharingPolicy, getUserType, getUserTypeByHandle, getUserTypes, getUserTypes as getUserTypes$1, getUserUsages, getUsers, getUsers as getUsers$1, getUsersByPath, getUsersMe, getUsersMeMeta, getVariable, getVariables, getVendorPrefix, getVerifiedAttributes, getVerifiedAttributes as getVerifiedAttributes$1, handleWebAuthnAuthentication, hasAdminVerificationStatus, hasAuthParamsInUrl, hasAuthParamsInUrl as hasAuthParamsInUrl$1, hasCalledForThisInstanceInUrl, hasPermission, hasPermission as hasPermission$1, hasUnresolvedTranslationParams, http, importConfiguration, isAdminVerifiableAttribute, isApplicationSubmissionValid, isEmojiUri, isEmpty, isFlowExpiredError, isFlowMetaUnavailableError, isSharingPolicyFormValid, isVerifiableAttribute, isVerifiableAttribute as isVerifiableAttribute$1, loadUntilOptionsGrow, mapCredentialUpdateError, mergeOptionsBatch, navigate, navigate as navigate$1, normalizeBorderRadius, normalizeSelectOptions, normalizeTranslations, parseKeyValuePairs, parseKeyValuePairs as parseKeyValuePairs$1, parseRedirectUris, previewCimdDocument, readCurrentProject, regenerateAgentSecret, regenerateClientSecret, regenerateClientSecret as regenerateClientSecret$1, regenerateFlowSecret, registerClient, removeGroupMembers, removeGroupMembers as removeGroupMembers$1, removeRoleAssignments, removeRoleAssignments as removeRoleAssignments$1, resolveAdministrationFlowHandles, resolveAdministrationFlowHandles as resolveAdministrationFlowHandles$1, resolveAdministrationFlowId, resolveAdministrationFlows, resolveAdministrationFlows as resolveAdministrationFlows$1, resolveChangeCredentialPolicy, resolveDesign, resolveFlowTemplateLiterals, resolveLogoUri, resolveManagedIdentityName, resolvePageSize, resolveRequestBaseUrl, resolveResourceEndpoint, resolveTranslation, resolveTranslations, restoreFlowVersion, revertGatewayConfiguration, runAccountLifecycleAction, runAccountLifecycleAction as runAccountLifecycleAction$1, runAdministrationFlow, sendUserAttributeVerification, sendUserAttributeVerification as sendUserAttributeVerification$1, setTranslation, setTranslations, splitConsentValidityPeriod, startCase, substituteTranslationParams, supportsCredential, suspendAgent, suspendApplication, suspendUser, toAuthFlowSelectPage, toCreateApplicationRequest, toEqualityFilter, toError, toManagementErrorMessage, toSharingPolicyFormValues, toSharingPolicyRequest, toSharingPolicyUpdateRequest, toUpdateApplicationRequest, toUserSelectPage, toUserTypeSelectPage, unlockAgent, unlockUser, unsuspendAgent, unsuspendApplication, unsuspendUser, updateAction, updateAgent, updateAgentType, updateApplication, updateApplication as updateApplication$1, updateApplicationSharingPolicy, updateAuthorizationDetailType, updateClientRegistration, updateConnection, updateCredentialConfiguration, updateDesignTheme, updateFlow, updateFlowSharingPolicy, updateFlowVariables, updateGateway, updateGatewaySecret, updateGatewayVariable, updateGroup, updateLayout, updateMeCredentials, updateMeProfile, updateNotificationTemplate, updateOrganizationUnit, updateOrganizationUnit as updateOrganizationUnit$1, updateOrganizationUnitByPath, updatePresentationDefinition, updateProject, updateProject as updateProject$1, updateResource, updateResourceServer, updateRole, updateRole as updateRole$1, updateRoleSharingPolicy, updateSecret, updateServerConfig, updateUser, updateUser as updateUser$1, updateUserCredentials, updateUserSharingPolicy, updateUserType, updateVariable, withVendorCSSClassPrefix, writeCurrentProject } from "@thunderid/browser";
|
|
2
|
+
import { Comment, Fragment, Teleport, cloneVNode, computed, defineComponent, getCurrentInstance, getCurrentScope, h, inject, isVNode, nextTick, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, provide, readonly, ref, shallowReadonly, shallowRef, toValue, useId, watch, watchEffect } from "vue";
|
|
3
3
|
import DOMPurify from "dompurify";
|
|
4
4
|
|
|
5
5
|
//#region src/keys.ts
|
|
@@ -3038,6 +3038,79 @@ const CONSENT_CSS = `
|
|
|
3038
3038
|
cursor: not-allowed;
|
|
3039
3039
|
opacity: 0.4;
|
|
3040
3040
|
}
|
|
3041
|
+
|
|
3042
|
+
.${withVendorCSSClassPrefix("consent__validity")} {
|
|
3043
|
+
display: flex;
|
|
3044
|
+
flex-direction: column;
|
|
3045
|
+
gap: calc(var(--thunderid-spacing-unit) * 2);
|
|
3046
|
+
margin-top: var(--thunderid-spacing-unit);
|
|
3047
|
+
}
|
|
3048
|
+
|
|
3049
|
+
.${withVendorCSSClassPrefix("consent__validity-group")} {
|
|
3050
|
+
display: flex;
|
|
3051
|
+
flex-direction: column;
|
|
3052
|
+
gap: calc(var(--thunderid-spacing-unit) * 0.5);
|
|
3053
|
+
}
|
|
3054
|
+
|
|
3055
|
+
.${withVendorCSSClassPrefix("consent__validity-remember")} {
|
|
3056
|
+
display: flex;
|
|
3057
|
+
align-items: center;
|
|
3058
|
+
gap: var(--thunderid-spacing-unit);
|
|
3059
|
+
color: var(--thunderid-color-text-primary);
|
|
3060
|
+
font-size: var(--thunderid-typography-fontSize-sm);
|
|
3061
|
+
font-weight: var(--thunderid-typography-fontWeight-medium);
|
|
3062
|
+
cursor: pointer;
|
|
3063
|
+
}
|
|
3064
|
+
|
|
3065
|
+
.${withVendorCSSClassPrefix("consent__validity-checkbox")} {
|
|
3066
|
+
cursor: pointer;
|
|
3067
|
+
}
|
|
3068
|
+
|
|
3069
|
+
.${withVendorCSSClassPrefix("consent__validity-input")} {
|
|
3070
|
+
box-sizing: border-box;
|
|
3071
|
+
width: 100%;
|
|
3072
|
+
height: var(--thunderid-input-height);
|
|
3073
|
+
padding: 0 var(--thunderid-input-paddingX);
|
|
3074
|
+
border: 1px solid var(--thunderid-input-borderColor);
|
|
3075
|
+
border-radius: var(--thunderid-input-borderRadius);
|
|
3076
|
+
background-color: var(--thunderid-color-background-surface);
|
|
3077
|
+
color: var(--thunderid-color-text-primary);
|
|
3078
|
+
font-family: var(--thunderid-typography-fontFamily);
|
|
3079
|
+
font-size: var(--thunderid-input-fontSize);
|
|
3080
|
+
cursor: pointer;
|
|
3081
|
+
}
|
|
3082
|
+
|
|
3083
|
+
.${withVendorCSSClassPrefix("consent__validity-custom")} {
|
|
3084
|
+
display: flex;
|
|
3085
|
+
align-items: flex-start;
|
|
3086
|
+
gap: calc(var(--thunderid-spacing-unit) * 1.5);
|
|
3087
|
+
}
|
|
3088
|
+
|
|
3089
|
+
.${withVendorCSSClassPrefix("consent__validity-custom")} .${withVendorCSSClassPrefix("consent__validity-input")} {
|
|
3090
|
+
cursor: text;
|
|
3091
|
+
}
|
|
3092
|
+
|
|
3093
|
+
.${withVendorCSSClassPrefix("consent__validity-custom")} input.${withVendorCSSClassPrefix("consent__validity-input")} {
|
|
3094
|
+
flex: 1;
|
|
3095
|
+
min-width: 0;
|
|
3096
|
+
}
|
|
3097
|
+
|
|
3098
|
+
.${withVendorCSSClassPrefix("consent__validity-custom")} select.${withVendorCSSClassPrefix("consent__validity-input")} {
|
|
3099
|
+
width: auto;
|
|
3100
|
+
flex: 0 0 auto;
|
|
3101
|
+
cursor: pointer;
|
|
3102
|
+
}
|
|
3103
|
+
|
|
3104
|
+
.${withVendorCSSClassPrefix("consent__validity-input")}:focus {
|
|
3105
|
+
border-color: var(--thunderid-input-focusBorderColor);
|
|
3106
|
+
box-shadow: var(--thunderid-input-focusRing);
|
|
3107
|
+
outline: none;
|
|
3108
|
+
}
|
|
3109
|
+
|
|
3110
|
+
.${withVendorCSSClassPrefix("consent__validity-hint")} {
|
|
3111
|
+
color: var(--thunderid-color-text-secondary);
|
|
3112
|
+
font-size: var(--thunderid-typography-fontSize-xs);
|
|
3113
|
+
}
|
|
3041
3114
|
`;
|
|
3042
3115
|
var Consent_css_default = CONSENT_CSS;
|
|
3043
3116
|
|
|
@@ -7949,6 +8022,18 @@ const normalizeFlowResponse = (response, t, options = {}, meta) => {
|
|
|
7949
8022
|
|
|
7950
8023
|
//#endregion
|
|
7951
8024
|
//#region src/components/auth/flow/Consent.ts
|
|
8025
|
+
const VALIDITY_TEXT_DEFAULTS = {
|
|
8026
|
+
custom_label: "Custom validity",
|
|
8027
|
+
custom_unit_label: "Unit",
|
|
8028
|
+
hint_custom: "Enter a whole number.",
|
|
8029
|
+
hint_custom_max: "Enter a whole number, up to {max}.",
|
|
8030
|
+
hint_expires: "Your consent expires in {duration}.",
|
|
8031
|
+
hint_never: "You will not be asked again unless this application asks for more access.",
|
|
8032
|
+
hint_once: "You will be asked again the next time you sign in.",
|
|
8033
|
+
option_custom: "Custom",
|
|
8034
|
+
option_never: "No expiry"
|
|
8035
|
+
};
|
|
8036
|
+
const CUSTOM_OPTION_ID = "custom";
|
|
7952
8037
|
const getConsentOptionalKey = (purposeId, attrName) => `__consent_opt__${purposeId}__${attrName}`;
|
|
7953
8038
|
const isObject = (value) => typeof value === "object" && value !== null;
|
|
7954
8039
|
const toPromptElements = (value) => Array.isArray(value) ? value.filter((element) => isObject(element) && typeof element["name"] === "string") : [];
|
|
@@ -7984,6 +8069,10 @@ const Consent = defineComponent({
|
|
|
7984
8069
|
required: true,
|
|
7985
8070
|
type: Object
|
|
7986
8071
|
},
|
|
8072
|
+
maxValidityPeriod: {
|
|
8073
|
+
default: void 0,
|
|
8074
|
+
type: Number
|
|
8075
|
+
},
|
|
7987
8076
|
onInputChange: {
|
|
7988
8077
|
required: true,
|
|
7989
8078
|
type: Function
|
|
@@ -7991,9 +8080,14 @@ const Consent = defineComponent({
|
|
|
7991
8080
|
t: {
|
|
7992
8081
|
default: void 0,
|
|
7993
8082
|
type: Function
|
|
8083
|
+
},
|
|
8084
|
+
validityInput: {
|
|
8085
|
+
default: false,
|
|
8086
|
+
type: Boolean
|
|
7994
8087
|
}
|
|
7995
8088
|
},
|
|
7996
8089
|
setup(props, { slots }) {
|
|
8090
|
+
const i18n = inject(I18N_KEY, null);
|
|
7997
8091
|
const translate = (key, fallback = "") => {
|
|
7998
8092
|
const value = props.t?.(key);
|
|
7999
8093
|
return value && value !== key ? value : fallback;
|
|
@@ -8017,15 +8111,127 @@ const Consent = defineComponent({
|
|
|
8017
8111
|
"aria-label": info,
|
|
8018
8112
|
role: "img"
|
|
8019
8113
|
}, [h(InfoIcon)]) : null].filter((node) => node !== null);
|
|
8114
|
+
const customOpen = ref(false);
|
|
8115
|
+
const customText = ref("");
|
|
8116
|
+
const customUnit = ref(getConsentValidityCustomUnits(props.maxValidityPeriod).includes("minute") ? "minute" : "second");
|
|
8117
|
+
const remembering = ref(getConsentValidityChoices(props.maxValidityPeriod, props.formValues[CONSENT_VALIDITY_PERIOD_KEY] ?? "").remember);
|
|
8118
|
+
watchEffect(() => {
|
|
8119
|
+
const value = props.formValues[CONSENT_VALIDITY_PERIOD_KEY] ?? "";
|
|
8120
|
+
const { initial, once } = getConsentValidityChoices(props.maxValidityPeriod, value);
|
|
8121
|
+
if (props.validityInput && once && value === "") props.onInputChange(CONSENT_VALIDITY_PERIOD_KEY, initial.value);
|
|
8122
|
+
}, { flush: "post" });
|
|
8123
|
+
const validityField = () => {
|
|
8124
|
+
const value = props.formValues[CONSENT_VALIDITY_PERIOD_KEY] ?? "";
|
|
8125
|
+
const { initial, once, remember, remembered, selected } = getConsentValidityChoices(props.maxValidityPeriod, value, remembering.value);
|
|
8126
|
+
if (!once) return null;
|
|
8127
|
+
const text = (key, params) => substituteTranslationParams(translate(`consent.validity_period.${key}`, VALIDITY_TEXT_DEFAULTS[key]), params);
|
|
8128
|
+
const textOf = (option) => getConsentValidityOptionText(option, text, i18n?.currentLanguage.value);
|
|
8129
|
+
const custom = remember && (customOpen.value || selected === void 0);
|
|
8130
|
+
const units = getConsentValidityCustomUnits(props.maxValidityPeriod);
|
|
8131
|
+
const prefilled = custom && !customOpen.value && Number.isFinite(Number(value)) ? splitConsentValidityPeriod(Number(value), units) : void 0;
|
|
8132
|
+
const unit = prefilled?.unit ?? customUnit.value;
|
|
8133
|
+
const amount = customOpen.value ? customText.value : prefilled?.amount ?? "";
|
|
8134
|
+
const maxAmount = getConsentValidityCustomMax(props.maxValidityPeriod, unit);
|
|
8135
|
+
const handleSelectChange = (event) => {
|
|
8136
|
+
const chosen = event.target.value;
|
|
8137
|
+
if (chosen === CUSTOM_OPTION_ID) {
|
|
8138
|
+
const current = selected?.kind === "period" ? splitConsentValidityPeriod(selected.seconds, units) : void 0;
|
|
8139
|
+
customOpen.value = true;
|
|
8140
|
+
customText.value = current?.amount ?? "";
|
|
8141
|
+
customUnit.value = current?.unit ?? customUnit.value;
|
|
8142
|
+
props.onInputChange(CONSENT_VALIDITY_PERIOD_KEY, selected?.kind === "period" ? selected.value : initial.value);
|
|
8143
|
+
return;
|
|
8144
|
+
}
|
|
8145
|
+
const picked = remembered.find((option) => option.id === chosen);
|
|
8146
|
+
if (picked) {
|
|
8147
|
+
customOpen.value = false;
|
|
8148
|
+
props.onInputChange(CONSENT_VALIDITY_PERIOD_KEY, picked.value);
|
|
8149
|
+
}
|
|
8150
|
+
};
|
|
8151
|
+
const applyCustom = (digits, nextUnit) => {
|
|
8152
|
+
const period = getConsentValidityCustomPeriod(digits, props.maxValidityPeriod, nextUnit);
|
|
8153
|
+
customOpen.value = true;
|
|
8154
|
+
customUnit.value = nextUnit;
|
|
8155
|
+
customText.value = period.amount === "" ? digits : period.amount;
|
|
8156
|
+
props.onInputChange(CONSENT_VALIDITY_PERIOD_KEY, period.seconds === "" ? initial.value : period.seconds);
|
|
8157
|
+
return period;
|
|
8158
|
+
};
|
|
8159
|
+
const handleCustomInput = (event) => {
|
|
8160
|
+
const field = event.target;
|
|
8161
|
+
applyCustom(field.value.replace(/\D/g, ""), unit);
|
|
8162
|
+
field.value = customText.value;
|
|
8163
|
+
};
|
|
8164
|
+
const handleUnitChange = (event) => {
|
|
8165
|
+
applyCustom(amount, event.target.value);
|
|
8166
|
+
};
|
|
8167
|
+
const hint = h("span", { class: withVendorCSSClassPrefix("consent__validity-hint") }, custom ? maxAmount === void 0 ? text("hint_custom") : text("hint_custom_max", { max: String(maxAmount) }) : textOf(selected ?? once).hint);
|
|
8168
|
+
const group = (...nodes) => h("div", { class: withVendorCSSClassPrefix("consent__validity-group") }, nodes);
|
|
8169
|
+
return h("div", { class: withVendorCSSClassPrefix("consent__validity") }, [
|
|
8170
|
+
group(h("label", {
|
|
8171
|
+
class: withVendorCSSClassPrefix("consent__validity-remember"),
|
|
8172
|
+
for: "consent_validity_remember"
|
|
8173
|
+
}, [h("input", {
|
|
8174
|
+
checked: remember,
|
|
8175
|
+
class: withVendorCSSClassPrefix("consent__validity-checkbox"),
|
|
8176
|
+
id: "consent_validity_remember",
|
|
8177
|
+
onChange: (event) => {
|
|
8178
|
+
const checked = event.target.checked;
|
|
8179
|
+
remembering.value = checked;
|
|
8180
|
+
customOpen.value = false;
|
|
8181
|
+
customText.value = "";
|
|
8182
|
+
props.onInputChange(CONSENT_ONE_TIME_KEY, checked ? "false" : "true");
|
|
8183
|
+
props.onInputChange(CONSENT_VALIDITY_PERIOD_KEY, checked ? initial.value : once.value);
|
|
8184
|
+
},
|
|
8185
|
+
type: "checkbox"
|
|
8186
|
+
}), translate("consent.validity_period.remember", "Remember my decision")]), remember ? null : hint),
|
|
8187
|
+
...remember ? [group(h("select", {
|
|
8188
|
+
"aria-label": translate("consent.validity_period.label", "Ask me again"),
|
|
8189
|
+
class: withVendorCSSClassPrefix("consent__validity-input"),
|
|
8190
|
+
id: "consent_validity_period",
|
|
8191
|
+
onChange: handleSelectChange,
|
|
8192
|
+
value: custom ? CUSTOM_OPTION_ID : selected?.id
|
|
8193
|
+
}, [...remembered.map((option) => h("option", {
|
|
8194
|
+
key: option.id,
|
|
8195
|
+
selected: !custom && option.id === selected?.id,
|
|
8196
|
+
value: option.id
|
|
8197
|
+
}, textOf(option).label)), h("option", {
|
|
8198
|
+
key: CUSTOM_OPTION_ID,
|
|
8199
|
+
selected: custom,
|
|
8200
|
+
value: CUSTOM_OPTION_ID
|
|
8201
|
+
}, text("option_custom"))]), custom ? null : hint)] : [],
|
|
8202
|
+
...custom ? [group(h("div", { class: withVendorCSSClassPrefix("consent__validity-custom") }, [h("input", {
|
|
8203
|
+
"aria-label": text("custom_label"),
|
|
8204
|
+
class: withVendorCSSClassPrefix("consent__validity-input"),
|
|
8205
|
+
id: "consent_validity_custom",
|
|
8206
|
+
inputmode: "numeric",
|
|
8207
|
+
onInput: handleCustomInput,
|
|
8208
|
+
pattern: "[0-9]*",
|
|
8209
|
+
type: "text",
|
|
8210
|
+
value: amount
|
|
8211
|
+
}), h("select", {
|
|
8212
|
+
"aria-label": text("custom_unit_label"),
|
|
8213
|
+
class: withVendorCSSClassPrefix("consent__validity-input"),
|
|
8214
|
+
id: "consent_validity_unit",
|
|
8215
|
+
onChange: handleUnitChange,
|
|
8216
|
+
value: unit
|
|
8217
|
+
}, units.map((option) => h("option", {
|
|
8218
|
+
key: option,
|
|
8219
|
+
selected: option === unit,
|
|
8220
|
+
value: option
|
|
8221
|
+
}, getConsentValidityUnitLabel(option, i18n?.currentLanguage.value))))]), hint)] : []
|
|
8222
|
+
]);
|
|
8223
|
+
};
|
|
8020
8224
|
return () => {
|
|
8021
8225
|
const purposes = parsePurposes(props.consentData);
|
|
8022
8226
|
if (purposes.length === 0) return null;
|
|
8023
8227
|
if (slots["default"]) return h("div", slots["default"]({
|
|
8024
8228
|
formValues: props.formValues,
|
|
8229
|
+
maxValidityPeriod: props.maxValidityPeriod,
|
|
8025
8230
|
onInputChange: props.onInputChange,
|
|
8026
|
-
purposes
|
|
8231
|
+
purposes,
|
|
8232
|
+
validityInput: props.validityInput
|
|
8027
8233
|
}));
|
|
8028
|
-
return h("div", { class: withVendorCSSClassPrefix("consent") }, purposes.map((purpose) => {
|
|
8234
|
+
return h("div", { class: withVendorCSSClassPrefix("consent") }, [...purposes.map((purpose) => {
|
|
8029
8235
|
const permission = purpose.type === "permissions";
|
|
8030
8236
|
const optionalName = permission ? translate("consent.optional_scope", "Optional Permissions") : translate("consent.optional_claims", "Optional Attributes");
|
|
8031
8237
|
const essentialName = permission ? translate("consent.essential_scope", "Essential Permissions") : translate("consent.essential_claims", "Essential Attributes");
|
|
@@ -8070,7 +8276,7 @@ const Consent = defineComponent({
|
|
|
8070
8276
|
class: withVendorCSSClassPrefix("consent__purpose"),
|
|
8071
8277
|
key: purpose.purposeId
|
|
8072
8278
|
}, [purpose.essential.length > 0 ? h("div", { class: withVendorCSSClassPrefix("consent__section") }, [h("div", { class: withVendorCSSClassPrefix("consent__header") }, sectionTitle(essentialName, translate(permission ? "consent.essential_scope.info" : "consent.essential_claims.info", permission ? "" : "These attributes are required for the service to function properly."))), itemList(purpose.essential, true)]) : null, purpose.optional.length > 0 ? h("div", { class: withVendorCSSClassPrefix("consent__section") }, [h("div", { class: withVendorCSSClassPrefix("consent__optional-header") }, [h("div", { class: withVendorCSSClassPrefix("consent__header") }, sectionTitle(optionalName, translate(permission ? "consent.optional_scope.info" : "consent.optional_claims.info", permission ? "" : "These attributes are optional and can be provided at your discretion."))), toggle(`consent_opt_${purpose.purposeId}_all`, allSelected, optionalName, (checked) => purpose.optional.forEach((element) => props.onInputChange(getConsentOptionalKey(purpose.purposeId, element.name), checked ? "true" : "false")))]), branches.length > 0 ? branchList(branches) : itemList(purpose.optional, false)]) : null]);
|
|
8073
|
-
}));
|
|
8279
|
+
}), props.validityInput ? validityField() : null]);
|
|
8074
8280
|
};
|
|
8075
8281
|
}
|
|
8076
8282
|
});
|
|
@@ -8998,9 +9204,13 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
|
|
|
8998
9204
|
const consentPrompt = options.additionalData?.["consentPrompt"];
|
|
8999
9205
|
if (consentPrompt && eventType.toUpperCase() === EmbeddedFlowEventType$1.Submit) {
|
|
9000
9206
|
const isDeny = componentVariant.toLowerCase() !== "primary";
|
|
9207
|
+
const oneTime = !isDeny && getConsentOneTime(formValues);
|
|
9208
|
+
const validityPeriod = isDeny || oneTime ? void 0 : getConsentValidityPeriod(formValues);
|
|
9001
9209
|
const decisions = {
|
|
9002
9210
|
approved: !isDeny,
|
|
9003
9211
|
...isDeny ? { reason: ConsentConstants.REASON_USER_DENIED } : {},
|
|
9212
|
+
...validityPeriod === void 0 ? {} : { validityPeriod },
|
|
9213
|
+
...oneTime ? { oneTime } : {},
|
|
9004
9214
|
purposes: consentPrompt.purposes.map((p) => ({
|
|
9005
9215
|
approved: !isDeny,
|
|
9006
9216
|
elements: [...(p.essential ?? []).map((e) => ({
|
|
@@ -9206,13 +9416,18 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
|
|
|
9206
9416
|
style: stackStyle
|
|
9207
9417
|
}, stackChildren.filter(Boolean));
|
|
9208
9418
|
}
|
|
9209
|
-
case EmbeddedFlowComponentType$1.Consent:
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9419
|
+
case EmbeddedFlowComponentType$1.Consent: {
|
|
9420
|
+
const { enabled: validityInput, maxValidityPeriod } = getConsentValidityInput(options.additionalData);
|
|
9421
|
+
return h(Consent_default, {
|
|
9422
|
+
consentData: options.additionalData?.["consentPrompt"],
|
|
9423
|
+
formValues,
|
|
9424
|
+
key,
|
|
9425
|
+
maxValidityPeriod,
|
|
9426
|
+
onInputChange,
|
|
9427
|
+
t: options.t,
|
|
9428
|
+
validityInput
|
|
9429
|
+
});
|
|
9430
|
+
}
|
|
9216
9431
|
case EmbeddedFlowComponentType$1.Timer: {
|
|
9217
9432
|
const textTemplate = resolve(component.label) || "Time remaining: {time}";
|
|
9218
9433
|
const timeoutMs = Number(options.additionalData?.["stepTimeout"]) || 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thunderid/vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"description": "Vue SDK for ThunderID",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"thunderid",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@thunderid/browser": "^1.
|
|
60
|
+
"@thunderid/browser": "^1.22.0",
|
|
61
61
|
"dompurify": "3.4.17",
|
|
62
62
|
"tslib": "2.8.1"
|
|
63
63
|
},
|