@thunderid/vue 0.11.4 → 0.12.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.
@@ -5517,17 +5517,21 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
5517
5517
  const consentPrompt = options.additionalData?.["consentPrompt"];
5518
5518
  if (consentPrompt && eventType.toUpperCase() === __thunderid_browser.EmbeddedFlowEventType.Submit) {
5519
5519
  const isDeny = componentVariant.toLowerCase() !== "primary";
5520
- const decisions = { purposes: consentPrompt.purposes.map((p) => ({
5520
+ const decisions = {
5521
5521
  approved: !isDeny,
5522
- elements: [...p.essential.map((e) => ({
5522
+ ...isDeny ? { reason: __thunderid_browser.ConsentConstants.REASON_USER_DENIED } : {},
5523
+ purposes: consentPrompt.purposes.map((p) => ({
5523
5524
  approved: !isDeny,
5524
- name: e.name
5525
- })), ...p.optional.map((e) => ({
5526
- approved: !isDeny && formValues[getConsentOptionalKey(p.purposeId, e.name)] === "true",
5527
- name: e.name
5528
- }))],
5529
- purposeName: p.purposeName ?? ""
5530
- })) };
5525
+ elements: [...(p.essential ?? []).map((e) => ({
5526
+ approved: !isDeny,
5527
+ name: e.name
5528
+ })), ...(p.optional ?? []).map((e) => ({
5529
+ approved: !isDeny && formValues[getConsentOptionalKey(p.purposeId, e.name)] === "true",
5530
+ name: e.name
5531
+ }))],
5532
+ purposeName: p.purposeName ?? ""
5533
+ }))
5534
+ };
5531
5535
  formData["consent_decisions"] = JSON.stringify(decisions);
5532
5536
  }
5533
5537
  if (eventType.toUpperCase() === __thunderid_browser.EmbeddedFlowEventType.Submit) options.onSubmit(component, formData, shouldSkipValidation);
@@ -6438,20 +6442,24 @@ const SignIn = (0, vue.defineComponent)({
6438
6442
  const submitAction = findAction(components.value);
6439
6443
  if (submitAction && submitAction.variant?.toLowerCase() !== "primary") isDeny = true;
6440
6444
  }
6441
- const decisions = { purposes: purposes.map((p) => ({
6445
+ const decisions = {
6442
6446
  approved: !isDeny,
6443
- elements: [...(p.essential ?? []).map((e) => ({
6447
+ ...isDeny ? { reason: __thunderid_browser.ConsentConstants.REASON_USER_DENIED } : {},
6448
+ purposes: purposes.map((p) => ({
6444
6449
  approved: !isDeny,
6445
- name: e.name
6446
- })), ...(p.optional ?? []).map((e) => {
6447
- const key = `__consent_opt__${p.purposeId}__${e.name}`;
6448
- return {
6449
- approved: isDeny ? false : processedInputs[key] !== "false",
6450
+ elements: [...(p.essential ?? []).map((e) => ({
6451
+ approved: !isDeny,
6450
6452
  name: e.name
6451
- };
6452
- })],
6453
- purposeName: p.purposeName
6454
- })) };
6453
+ })), ...(p.optional ?? []).map((e) => {
6454
+ const key = `__consent_opt__${p.purposeId}__${e.name}`;
6455
+ return {
6456
+ approved: !isDeny && processedInputs[key] === "true",
6457
+ name: e.name
6458
+ };
6459
+ })],
6460
+ purposeName: p.purposeName
6461
+ }))
6462
+ };
6455
6463
  processedInputs["consent_decisions"] = JSON.stringify(decisions);
6456
6464
  Object.keys(processedInputs).forEach((key) => {
6457
6465
  if (key.startsWith("__consent_opt__")) delete processedInputs[key];
@@ -1 +1 @@
1
- {"version":3,"file":"AuthOptionFactoryCore.d.ts","sourceRoot":"","sources":["../../../../src/components/auth/sign-in/AuthOptionFactoryCore.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,oBAAoB,EACpB,qBAAqB,EAYtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAI,KAAK,KAAK,EAAC,MAAM,KAAK,CAAC;AA+ClC,KAAK,aAAa,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;AA0YvF,YAAY,EAAC,aAAa,EAAC,CAAC;AAE5B;;GAEG;AACH,eAAO,MAAM,sBAAsB,GACjC,YAAY,qBAAqB,EAAE,EACnC,YAAY,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,eAAe,M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":"SignIn.d.ts","sourceRoot":"","sources":["../../../../src/components/auth/sign-in/SignIn.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,qBAAqB,EAErB,yBAAyB,EAIzB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,SAAS,EAWf,MAAM,KAAK,CAAC;AAmBb;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,UAAU,EAAE,qBAAqB,EAAE,CAAC;IACpC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,MAAM,EAAE,SAmjBZ,CAAC;AAEH,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"SignIn.d.ts","sourceRoot":"","sources":["../../../../src/components/auth/sign-in/SignIn.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,qBAAqB,EAErB,yBAAyB,EAIzB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,SAAS,EAWf,MAAM,KAAK,CAAC;AAmBb;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,UAAU,EAAE,qBAAqB,EAAE,CAAC;IACpC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,MAAM,EAAE,SAqjBZ,CAAC;AAEH,eAAe,MAAM,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { 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, getVendorPrefix, handleWebAuthnAuthentication, hasAuthParamsInUrl, hasAuthParamsInUrl as hasAuthParamsInUrl$1, hasCalledForThisInstanceInUrl, http, isEmojiUri, isEmpty, navigate, navigate as navigate$1, normalizeBorderRadius, normalizeTranslations, resolveFlowTemplateLiterals, resolveLogoUri, resolveResourceEndpoint, updateMeProfile, withVendorCSSClassPrefix } from "@thunderid/browser";
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, getVendorPrefix, handleWebAuthnAuthentication, hasAuthParamsInUrl, hasAuthParamsInUrl as hasAuthParamsInUrl$1, hasCalledForThisInstanceInUrl, http, isEmojiUri, isEmpty, navigate, navigate as navigate$1, normalizeBorderRadius, normalizeTranslations, resolveFlowTemplateLiterals, resolveLogoUri, resolveResourceEndpoint, updateMeProfile, withVendorCSSClassPrefix } from "@thunderid/browser";
2
2
  import { Fragment, computed, defineComponent, h, inject, nextTick, onBeforeUnmount, onMounted, onUnmounted, provide, readonly, ref, shallowReadonly, shallowRef, watch } from "vue";
3
3
  import DOMPurify from "dompurify";
4
4
 
@@ -5491,17 +5491,21 @@ const createAuthComponentFromFlow = (component, formValues, touchedFields, formE
5491
5491
  const consentPrompt = options.additionalData?.["consentPrompt"];
5492
5492
  if (consentPrompt && eventType.toUpperCase() === EmbeddedFlowEventType$1.Submit) {
5493
5493
  const isDeny = componentVariant.toLowerCase() !== "primary";
5494
- const decisions = { purposes: consentPrompt.purposes.map((p) => ({
5494
+ const decisions = {
5495
5495
  approved: !isDeny,
5496
- elements: [...p.essential.map((e) => ({
5496
+ ...isDeny ? { reason: ConsentConstants.REASON_USER_DENIED } : {},
5497
+ purposes: consentPrompt.purposes.map((p) => ({
5497
5498
  approved: !isDeny,
5498
- name: e.name
5499
- })), ...p.optional.map((e) => ({
5500
- approved: !isDeny && formValues[getConsentOptionalKey(p.purposeId, e.name)] === "true",
5501
- name: e.name
5502
- }))],
5503
- purposeName: p.purposeName ?? ""
5504
- })) };
5499
+ elements: [...(p.essential ?? []).map((e) => ({
5500
+ approved: !isDeny,
5501
+ name: e.name
5502
+ })), ...(p.optional ?? []).map((e) => ({
5503
+ approved: !isDeny && formValues[getConsentOptionalKey(p.purposeId, e.name)] === "true",
5504
+ name: e.name
5505
+ }))],
5506
+ purposeName: p.purposeName ?? ""
5507
+ }))
5508
+ };
5505
5509
  formData["consent_decisions"] = JSON.stringify(decisions);
5506
5510
  }
5507
5511
  if (eventType.toUpperCase() === EmbeddedFlowEventType$1.Submit) options.onSubmit(component, formData, shouldSkipValidation);
@@ -6412,20 +6416,24 @@ const SignIn = defineComponent({
6412
6416
  const submitAction = findAction(components.value);
6413
6417
  if (submitAction && submitAction.variant?.toLowerCase() !== "primary") isDeny = true;
6414
6418
  }
6415
- const decisions = { purposes: purposes.map((p) => ({
6419
+ const decisions = {
6416
6420
  approved: !isDeny,
6417
- elements: [...(p.essential ?? []).map((e) => ({
6421
+ ...isDeny ? { reason: ConsentConstants.REASON_USER_DENIED } : {},
6422
+ purposes: purposes.map((p) => ({
6418
6423
  approved: !isDeny,
6419
- name: e.name
6420
- })), ...(p.optional ?? []).map((e) => {
6421
- const key = `__consent_opt__${p.purposeId}__${e.name}`;
6422
- return {
6423
- approved: isDeny ? false : processedInputs[key] !== "false",
6424
+ elements: [...(p.essential ?? []).map((e) => ({
6425
+ approved: !isDeny,
6424
6426
  name: e.name
6425
- };
6426
- })],
6427
- purposeName: p.purposeName
6428
- })) };
6427
+ })), ...(p.optional ?? []).map((e) => {
6428
+ const key = `__consent_opt__${p.purposeId}__${e.name}`;
6429
+ return {
6430
+ approved: !isDeny && processedInputs[key] === "true",
6431
+ name: e.name
6432
+ };
6433
+ })],
6434
+ purposeName: p.purposeName
6435
+ }))
6436
+ };
6429
6437
  processedInputs["consent_decisions"] = JSON.stringify(decisions);
6430
6438
  Object.keys(processedInputs).forEach((key) => {
6431
6439
  if (key.startsWith("__consent_opt__")) delete processedInputs[key];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thunderid/vue",
3
- "version": "0.11.4",
3
+ "version": "0.12.0",
4
4
  "description": "Vue SDK for ThunderID",
5
5
  "keywords": [
6
6
  "thunderid",
@@ -58,7 +58,7 @@
58
58
  "dependencies": {
59
59
  "dompurify": "3.4.11",
60
60
  "tslib": "2.8.1",
61
- "@thunderid/browser": "^0.11.4"
61
+ "@thunderid/browser": "^0.12.0"
62
62
  },
63
63
  "publishConfig": {
64
64
  "access": "public"