@unidy.io/sdk 1.1.2 → 1.1.4
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/app-globals-DSKjcXX_.js +10 -0
- package/dist/cjs/app-globals-DSKjcXX_.js.map +1 -0
- package/dist/cjs/auth-NU3DBc-6.js +581 -0
- package/dist/cjs/auth-NU3DBc-6.js.map +1 -0
- package/dist/cjs/auth-store-BaxuIp4z.js +185 -0
- package/dist/cjs/auth-store-BaxuIp4z.js.map +1 -0
- package/dist/cjs/component-utils-BpMyeVQo.js +35 -0
- package/dist/cjs/component-utils-BpMyeVQo.js.map +1 -0
- package/dist/cjs/flash-store-BuIBuQDx.js +50 -0
- package/dist/cjs/flash-store-BuIBuQDx.js.map +1 -0
- package/dist/cjs/helpers-BcPlKlBG.js +11 -0
- package/dist/cjs/helpers-BcPlKlBG.js.map +1 -0
- package/dist/cjs/helpers-DJyRa0Qo.js +11 -0
- package/dist/cjs/helpers-DJyRa0Qo.js.map +1 -0
- package/dist/cjs/i18n-BoDZ8kd2.js +3236 -0
- package/dist/cjs/i18n-BoDZ8kd2.js.map +1 -0
- package/dist/cjs/index-B_N5xKgH.js +12025 -0
- package/dist/cjs/index-B_N5xKgH.js.map +1 -0
- package/dist/cjs/index-DLz3FT7T.js +214 -0
- package/dist/cjs/index-DLz3FT7T.js.map +1 -0
- package/dist/cjs/index-R2MKLaem.js +5267 -0
- package/dist/cjs/index-R2MKLaem.js.map +1 -0
- package/dist/cjs/index.cjs.js +64 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +14 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/newsletter-helpers-DR0vsegt.js +289 -0
- package/dist/cjs/newsletter-helpers-DR0vsegt.js.map +1 -0
- package/dist/cjs/newsletter-store-BzytX7Qh.js +38 -0
- package/dist/cjs/newsletter-store-BzytX7Qh.js.map +1 -0
- package/dist/cjs/pagination-store-BEiW3MQd.js +16 -0
- package/dist/cjs/pagination-store-BEiW3MQd.js.map +1 -0
- package/dist/cjs/profile-helpers-B2h2III_.js +39 -0
- package/dist/cjs/profile-helpers-B2h2III_.js.map +1 -0
- package/dist/cjs/profile-store-P_BcYkef.js +22 -0
- package/dist/cjs/profile-store-P_BcYkef.js.map +1 -0
- package/dist/cjs/sdk.cjs.js +26 -0
- package/dist/cjs/sdk.cjs.js.map +1 -0
- package/dist/cjs/u-conditional-render.cjs.entry.js +103 -0
- package/dist/cjs/u-conditional-render.entry.cjs.js.map +1 -0
- package/dist/cjs/u-config.cjs.entry.js +87 -0
- package/dist/cjs/u-config.entry.cjs.js.map +1 -0
- package/dist/cjs/u-email-field.cjs.entry.js +77 -0
- package/dist/cjs/u-email-field.entry.cjs.js.map +1 -0
- package/dist/cjs/u-error-message.cjs.entry.js +82 -0
- package/dist/cjs/u-error-message.entry.cjs.js.map +1 -0
- package/dist/cjs/u-field.u-raw-field.entry.cjs.js.map +1 -0
- package/dist/cjs/u-field_2.cjs.entry.js +375 -0
- package/dist/cjs/u-flash-message.cjs.entry.js +37 -0
- package/dist/cjs/u-flash-message.entry.cjs.js.map +1 -0
- package/dist/cjs/u-full-profile.cjs.entry.js +37 -0
- package/dist/cjs/u-full-profile.entry.cjs.js.map +1 -0
- package/dist/cjs/u-logout-button.cjs.entry.js +38 -0
- package/dist/cjs/u-logout-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-magic-code-field.cjs.entry.js +91 -0
- package/dist/cjs/u-magic-code-field.entry.cjs.js.map +1 -0
- package/dist/cjs/u-missing-field.cjs.entry.js +22 -0
- package/dist/cjs/u-missing-field.entry.cjs.js.map +1 -0
- package/dist/cjs/u-missing-fields-submit-button.cjs.entry.js +46 -0
- package/dist/cjs/u-missing-fields-submit-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-newsletter-checkbox.cjs.entry.js +63 -0
- package/dist/cjs/u-newsletter-checkbox.entry.cjs.js.map +1 -0
- package/dist/cjs/u-newsletter-logout-button.cjs.entry.js +36 -0
- package/dist/cjs/u-newsletter-logout-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-newsletter-preference-checkbox.cjs.entry.js +106 -0
- package/dist/cjs/u-newsletter-preference-checkbox.entry.cjs.js.map +1 -0
- package/dist/cjs/u-newsletter-resend-doi-button.cjs.entry.js +49 -0
- package/dist/cjs/u-newsletter-resend-doi-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-newsletter-root.cjs.entry.js +72 -0
- package/dist/cjs/u-newsletter-root.entry.cjs.js.map +1 -0
- package/dist/cjs/u-newsletter-toggle-subscription-button.cjs.entry.js +73 -0
- package/dist/cjs/u-newsletter-toggle-subscription-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-pagination-button.cjs.entry.js +63 -0
- package/dist/cjs/u-pagination-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-pagination-page.cjs.entry.js +44 -0
- package/dist/cjs/u-pagination-page.entry.cjs.js.map +1 -0
- package/dist/cjs/u-passkey.cjs.entry.js +47 -0
- package/dist/cjs/u-passkey.entry.cjs.js.map +1 -0
- package/dist/cjs/u-password-field.cjs.entry.js +104 -0
- package/dist/cjs/u-password-field.entry.cjs.js.map +1 -0
- package/dist/cjs/u-profile.u-submit-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-profile_2.cjs.entry.js +327 -0
- package/dist/cjs/u-registration-button.cjs.entry.js +48 -0
- package/dist/cjs/u-registration-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-reset-password-button.cjs.entry.js +47 -0
- package/dist/cjs/u-reset-password-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-send-magic-code-button.cjs.entry.js +68 -0
- package/dist/cjs/u-send-magic-code-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-signed-in.cjs.entry.js +25 -0
- package/dist/cjs/u-signed-in.entry.cjs.js.map +1 -0
- package/dist/cjs/u-signin-root.cjs.entry.js +43 -0
- package/dist/cjs/u-signin-root.entry.cjs.js.map +1 -0
- package/dist/cjs/u-signin-step.cjs.entry.js +66 -0
- package/dist/cjs/u-signin-step.entry.cjs.js.map +1 -0
- package/dist/cjs/u-signin-strategy.cjs.entry.js +30 -0
- package/dist/cjs/u-signin-strategy.entry.cjs.js.map +1 -0
- package/dist/cjs/u-social-login-button.cjs.entry.js +100 -0
- package/dist/cjs/u-social-login-button.entry.cjs.js.map +1 -0
- package/dist/cjs/u-spinner.cjs.entry.js +18 -0
- package/dist/cjs/u-spinner.entry.cjs.js.map +1 -0
- package/dist/cjs/u-ticketable-list.cjs.entry.js +6087 -0
- package/dist/cjs/u-ticketable-list.entry.cjs.js.map +1 -0
- package/dist/cjs/unidy-store-7AbWnZ6g.js +41 -0
- package/dist/cjs/unidy-store-7AbWnZ6g.js.map +1 -0
- package/dist/collection/api/client.js +144 -0
- package/dist/collection/api/client.js.map +1 -0
- package/dist/collection/api/index.js +42 -0
- package/dist/collection/api/index.js.map +1 -0
- package/dist/collection/api/shared.js +18 -0
- package/dist/collection/api/shared.js.map +1 -0
- package/dist/collection/auth/api/auth.js +264 -0
- package/dist/collection/auth/api/auth.js.map +1 -0
- package/dist/collection/auth/auth-helpers.js +299 -0
- package/dist/collection/auth/auth-helpers.js.map +1 -0
- package/dist/collection/auth/auth.js +121 -0
- package/dist/collection/auth/auth.js.map +1 -0
- package/dist/collection/auth/components/helpers.js +5 -0
- package/dist/collection/auth/components/helpers.js.map +1 -0
- package/dist/collection/auth/components/logout-button/logout-button.js +85 -0
- package/dist/collection/auth/components/logout-button/logout-button.js.map +1 -0
- package/dist/collection/auth/components/magic-code-field/magic-code-field.css +1 -0
- package/dist/collection/auth/components/magic-code-field/magic-code-field.js +113 -0
- package/dist/collection/auth/components/magic-code-field/magic-code-field.js.map +1 -0
- package/dist/collection/auth/components/missing-field/missing-field.js +14 -0
- package/dist/collection/auth/components/missing-field/missing-field.js.map +1 -0
- package/dist/collection/auth/components/missing-fields-submit-button/missing-fields-submit-button.js +39 -0
- package/dist/collection/auth/components/missing-fields-submit-button/missing-fields-submit-button.js.map +1 -0
- package/dist/collection/auth/components/passkey/passkey.js +103 -0
- package/dist/collection/auth/components/passkey/passkey.js.map +1 -0
- package/dist/collection/auth/components/password-field/password-field.js +166 -0
- package/dist/collection/auth/components/password-field/password-field.js.map +1 -0
- package/dist/collection/auth/components/registration/registration-button.js +104 -0
- package/dist/collection/auth/components/registration/registration-button.js.map +1 -0
- package/dist/collection/auth/components/reset-pass-button/reset-pass-button.js +59 -0
- package/dist/collection/auth/components/reset-pass-button/reset-pass-button.js.map +1 -0
- package/dist/collection/auth/components/send-magic-code-button/send-magic-code-button.js +104 -0
- package/dist/collection/auth/components/send-magic-code-button/send-magic-code-button.js.map +1 -0
- package/dist/collection/auth/components/signed-in/signed-in.js +59 -0
- package/dist/collection/auth/components/signed-in/signed-in.js.map +1 -0
- package/dist/collection/auth/components/signin-root/signin-root.js +97 -0
- package/dist/collection/auth/components/signin-root/signin-root.js.map +1 -0
- package/dist/collection/auth/components/signin-step/signin-step.js +135 -0
- package/dist/collection/auth/components/signin-step/signin-step.js.map +1 -0
- package/dist/collection/auth/components/signin-strategy/signin-strategy.js +64 -0
- package/dist/collection/auth/components/signin-strategy/signin-strategy.js.map +1 -0
- package/dist/collection/auth/components/social-logins/logos/apple.js +3 -0
- package/dist/collection/auth/components/social-logins/logos/apple.js.map +1 -0
- package/dist/collection/auth/components/social-logins/logos/discord.js +3 -0
- package/dist/collection/auth/components/social-logins/logos/discord.js.map +1 -0
- package/dist/collection/auth/components/social-logins/logos/facebook.js +3 -0
- package/dist/collection/auth/components/social-logins/logos/facebook.js.map +1 -0
- package/dist/collection/auth/components/social-logins/logos/google.js +3 -0
- package/dist/collection/auth/components/social-logins/logos/google.js.map +1 -0
- package/dist/collection/auth/components/social-logins/logos/linkedin.js +3 -0
- package/dist/collection/auth/components/social-logins/logos/linkedin.js.map +1 -0
- package/dist/collection/auth/components/social-logins/social-login-button.css +1 -0
- package/dist/collection/auth/components/social-logins/social-login-button.js +188 -0
- package/dist/collection/auth/components/social-logins/social-login-button.js.map +1 -0
- package/dist/collection/auth/components/submit-button/auth-submit-button.js +62 -0
- package/dist/collection/auth/components/submit-button/auth-submit-button.js.map +1 -0
- package/dist/{sdk/index-Cz3idqu9.js → collection/auth/error-definitions.js} +2 -19
- package/dist/collection/auth/error-definitions.js.map +1 -0
- package/dist/collection/auth/index.js +14 -0
- package/dist/collection/auth/index.js.map +1 -0
- package/dist/collection/auth/passkey-auth.js +106 -0
- package/dist/collection/auth/passkey-auth.js.map +1 -0
- package/dist/collection/auth/store/auth-store.js +176 -0
- package/dist/collection/auth/store/auth-store.js.map +1 -0
- package/dist/collection/collection-manifest.json +46 -0
- package/dist/collection/globalScript.js +18 -0
- package/dist/collection/globalScript.js.map +1 -0
- package/dist/collection/i18n.js +31 -0
- package/dist/collection/i18n.js.map +1 -0
- package/dist/collection/index.js +16 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/locales/de.json +133 -0
- package/dist/collection/locales/en.json +133 -0
- package/dist/collection/locales/fr.json +133 -0
- package/dist/collection/locales/it.json +133 -0
- package/dist/collection/locales/nl_be.json +133 -0
- package/dist/collection/locales/ro.json +133 -0
- package/dist/collection/logger.js +106 -0
- package/dist/collection/logger.js.map +1 -0
- package/dist/collection/newsletter/api/newsletters.js +189 -0
- package/dist/collection/newsletter/api/newsletters.js.map +1 -0
- package/dist/collection/newsletter/components/helpers.js +5 -0
- package/dist/collection/newsletter/components/helpers.js.map +1 -0
- package/dist/collection/newsletter/components/logout-button/logout-button.js +48 -0
- package/dist/collection/newsletter/components/logout-button/logout-button.js.map +1 -0
- package/dist/collection/newsletter/components/newsletter-checkbox/newsletter-checkbox.js +109 -0
- package/dist/collection/newsletter/components/newsletter-checkbox/newsletter-checkbox.js.map +1 -0
- package/dist/collection/newsletter/components/newsletter-root/newsletter-root.js +119 -0
- package/dist/collection/newsletter/components/newsletter-root/newsletter-root.js.map +1 -0
- package/dist/collection/newsletter/components/preference-checkbox/preference-checkbox.js +178 -0
- package/dist/collection/newsletter/components/preference-checkbox/preference-checkbox.js.map +1 -0
- package/dist/collection/newsletter/components/resend-doi-button/resend-doi-button.css +1 -0
- package/dist/collection/newsletter/components/resend-doi-button/resend-doi-button.js +89 -0
- package/dist/collection/newsletter/components/resend-doi-button/resend-doi-button.js.map +1 -0
- package/dist/collection/newsletter/components/submit-button/newsletter-submit-button.js +18 -0
- package/dist/collection/newsletter/components/submit-button/newsletter-submit-button.js.map +1 -0
- package/dist/collection/newsletter/components/toggle-subscription-button/toggle-subscription-button.css +1 -0
- package/dist/collection/newsletter/components/toggle-subscription-button/toggle-subscription-button.js +154 -0
- package/dist/collection/newsletter/components/toggle-subscription-button/toggle-subscription-button.js.map +1 -0
- package/dist/collection/newsletter/index.js +11 -0
- package/dist/collection/newsletter/index.js.map +1 -0
- package/dist/collection/newsletter/newsletter-helpers.js +277 -0
- package/dist/collection/newsletter/newsletter-helpers.js.map +1 -0
- package/dist/collection/newsletter/store/newsletter-store.js +34 -0
- package/dist/collection/newsletter/store/newsletter-store.js.map +1 -0
- package/dist/collection/profile/api/profile.js +168 -0
- package/dist/collection/profile/api/profile.js.map +1 -0
- package/dist/collection/profile/components/field/field.css +1 -0
- package/dist/collection/profile/components/field/field.js +359 -0
- package/dist/collection/profile/components/field/field.js.map +1 -0
- package/dist/collection/profile/components/full-profile/full-profile.css +1 -0
- package/dist/collection/profile/components/full-profile/full-profile.js +78 -0
- package/dist/collection/profile/components/full-profile/full-profile.js.map +1 -0
- package/dist/collection/profile/components/profile/profile.js +250 -0
- package/dist/collection/profile/components/profile/profile.js.map +1 -0
- package/dist/collection/profile/components/raw-field/raw-field.js +697 -0
- package/dist/collection/profile/components/raw-field/raw-field.js.map +1 -0
- package/dist/collection/profile/components/raw-input-fields/Input.js +3 -0
- package/dist/collection/profile/components/raw-input-fields/Input.js.map +1 -0
- package/dist/collection/profile/components/raw-input-fields/MultiSelect.js +8 -0
- package/dist/collection/profile/components/raw-input-fields/MultiSelect.js.map +1 -0
- package/dist/collection/profile/components/raw-input-fields/RadioGroup.js +8 -0
- package/dist/collection/profile/components/raw-input-fields/RadioGroup.js.map +1 -0
- package/dist/collection/profile/components/raw-input-fields/Select.js +11 -0
- package/dist/collection/profile/components/raw-input-fields/Select.js.map +1 -0
- package/dist/collection/profile/components/raw-input-fields/Textarea.js +3 -0
- package/dist/collection/profile/components/raw-input-fields/Textarea.js.map +1 -0
- package/dist/collection/profile/components/submit-button/profile-submit-button.js +17 -0
- package/dist/collection/profile/components/submit-button/profile-submit-button.js.map +1 -0
- package/dist/collection/profile/index.js +13 -0
- package/dist/collection/profile/index.js.map +1 -0
- package/dist/collection/profile/profile-helpers.js +31 -0
- package/dist/collection/profile/profile-helpers.js.map +1 -0
- package/dist/collection/profile/store/profile-store.js +15 -0
- package/dist/collection/profile/store/profile-store.js.map +1 -0
- package/dist/collection/sdk.css +39 -0
- package/dist/collection/shared/component-utils.js +28 -0
- package/dist/collection/shared/component-utils.js.map +1 -0
- package/dist/collection/shared/components/conditional-render/conditional-render.js +178 -0
- package/dist/collection/shared/components/conditional-render/conditional-render.js.map +1 -0
- package/dist/collection/shared/components/config/config.js +260 -0
- package/dist/collection/shared/components/config/config.js.map +1 -0
- package/dist/collection/shared/components/email-field/email-field.css +1 -0
- package/dist/collection/shared/components/email-field/email-field.js +145 -0
- package/dist/collection/shared/components/email-field/email-field.js.map +1 -0
- package/dist/collection/shared/components/error-message/error-message.js +141 -0
- package/dist/collection/shared/components/error-message/error-message.js.map +1 -0
- package/dist/collection/shared/components/flash-message/close-icon.js +3 -0
- package/dist/collection/shared/components/flash-message/close-icon.js.map +1 -0
- package/dist/collection/shared/components/flash-message/flash-message.css +1 -0
- package/dist/collection/shared/components/flash-message/flash-message.js +79 -0
- package/dist/collection/shared/components/flash-message/flash-message.js.map +1 -0
- package/dist/collection/shared/components/spinner/spinner.css +1 -0
- package/dist/collection/shared/components/spinner/spinner.js +19 -0
- package/dist/collection/shared/components/spinner/spinner.js.map +1 -0
- package/dist/collection/shared/components/submit-button/context.js +10 -0
- package/dist/collection/shared/components/submit-button/context.js.map +1 -0
- package/dist/collection/shared/components/submit-button/submit-button.css +1 -0
- package/dist/collection/shared/components/submit-button/submit-button.js +196 -0
- package/dist/collection/shared/components/submit-button/submit-button.js.map +1 -0
- package/dist/collection/shared/store/flash-store.js +43 -0
- package/dist/collection/shared/store/flash-store.js.map +1 -0
- package/dist/collection/shared/store/unidy-store.js +33 -0
- package/dist/collection/shared/store/unidy-store.js.map +1 -0
- package/dist/collection/ticketable/api/get-with-schema.js +35 -0
- package/dist/collection/ticketable/api/get-with-schema.js.map +1 -0
- package/dist/collection/ticketable/api/schemas.js +12 -0
- package/dist/collection/ticketable/api/schemas.js.map +1 -0
- package/dist/collection/ticketable/api/subscriptions.js +47 -0
- package/dist/collection/ticketable/api/subscriptions.js.map +1 -0
- package/dist/collection/ticketable/api/tickets.js +48 -0
- package/dist/collection/ticketable/api/tickets.js.map +1 -0
- package/dist/collection/ticketable/components/pagination/pagination-button.js +108 -0
- package/dist/collection/ticketable/components/pagination/pagination-button.js.map +1 -0
- package/dist/collection/ticketable/components/pagination/pagination-page.js +69 -0
- package/dist/collection/ticketable/components/pagination/pagination-page.js.map +1 -0
- package/dist/collection/ticketable/components/ticketable-list/skeleton-helpers.js +54 -0
- package/dist/collection/ticketable/components/ticketable-list/skeleton-helpers.js.map +1 -0
- package/dist/collection/ticketable/components/ticketable-list/ticketable-list.js +498 -0
- package/dist/collection/ticketable/components/ticketable-list/ticketable-list.js.map +1 -0
- package/dist/collection/ticketable/index.js +13 -0
- package/dist/collection/ticketable/index.js.map +1 -0
- package/dist/collection/ticketable/store/pagination-store.js +9 -0
- package/dist/collection/ticketable/store/pagination-store.js.map +1 -0
- package/dist/{sdk/auth-store-CapiC8gJ.js → components/auth-store.js} +5 -4
- package/dist/components/auth-store.js.map +1 -0
- package/dist/components/auth.js +580 -0
- package/dist/components/auth.js.map +1 -0
- package/dist/components/component-utils.js +32 -0
- package/dist/components/component-utils.js.map +1 -0
- package/dist/components/exports.js +4106 -0
- package/dist/components/exports.js.map +1 -0
- package/dist/{sdk/u-field.entry.js → components/field.js} +57 -14
- package/dist/components/field.js.map +1 -0
- package/dist/{sdk/flash-store-DNcSEn2p.js → components/flash-store.js} +3 -4
- package/dist/components/flash-store.js.map +1 -0
- package/dist/components/helpers.js +9 -0
- package/dist/components/helpers.js.map +1 -0
- package/dist/components/helpers2.js +9 -0
- package/dist/components/helpers2.js.map +1 -0
- package/dist/{sdk/i18n-BCI_ARJL.js → components/i18n.js} +11 -19
- package/dist/components/i18n.js.map +1 -0
- package/dist/components/index.js +5902 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index2.js +5256 -0
- package/dist/components/index2.js.map +1 -0
- package/dist/{sdk/index-BnBstyfp.js → components/index3.js} +3 -3
- package/dist/components/index3.js.map +1 -0
- package/dist/components/logger.js +111 -0
- package/dist/components/logger.js.map +1 -0
- package/dist/{sdk/newsletter-helpers-DEXEBD0F.js → components/newsletter-helpers.js} +14 -12
- package/dist/components/newsletter-helpers.js.map +1 -0
- package/dist/{sdk/newsletter-store-CvULKmsu.js → components/newsletter-store.js} +3 -8
- package/dist/components/newsletter-store.js.map +1 -0
- package/dist/components/pagination-store.js +14 -0
- package/dist/components/pagination-store.js.map +1 -0
- package/dist/{sdk/profile-helpers-Bs3aj0CO.js → components/profile-helpers.js} +4 -4
- package/dist/components/profile-helpers.js.map +1 -0
- package/dist/{sdk/profile-store-DD6sq42i.js → components/profile-store.js} +3 -3
- package/dist/components/profile-store.js.map +1 -0
- package/dist/{sdk/u-profile.entry.js → components/profile.js} +54 -20
- package/dist/components/profile.js.map +1 -0
- package/dist/{sdk/u-raw-field.entry.js → components/raw-field.js} +51 -10
- package/dist/components/raw-field.js.map +1 -0
- package/dist/components/spinner.js +35 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/{sdk/u-submit-button.entry.js → components/submit-button.js} +46 -19
- package/dist/components/submit-button.js.map +1 -0
- package/dist/components/u-conditional-render.js +121 -0
- package/dist/components/u-conditional-render.js.map +1 -0
- package/dist/components/u-config.js +113 -0
- package/dist/components/u-config.js.map +1 -0
- package/dist/components/u-email-field.js +99 -0
- package/dist/components/u-email-field.js.map +1 -0
- package/dist/components/u-error-message.js +105 -0
- package/dist/components/u-error-message.js.map +1 -0
- package/dist/components/u-field.js +9 -0
- package/dist/components/u-field.js.map +1 -0
- package/dist/components/u-flash-message.js +58 -0
- package/dist/components/u-flash-message.js.map +1 -0
- package/dist/components/u-full-profile.js +87 -0
- package/dist/components/u-full-profile.js.map +1 -0
- package/dist/components/u-logout-button.js +53 -0
- package/dist/components/u-logout-button.js.map +1 -0
- package/dist/components/u-magic-code-field.js +106 -0
- package/dist/components/u-magic-code-field.js.map +1 -0
- package/dist/components/u-missing-field.js +57 -0
- package/dist/components/u-missing-field.js.map +1 -0
- package/dist/components/u-missing-fields-submit-button.js +70 -0
- package/dist/components/u-missing-fields-submit-button.js.map +1 -0
- package/dist/components/u-newsletter-checkbox.js +77 -0
- package/dist/components/u-newsletter-checkbox.js.map +1 -0
- package/dist/components/u-newsletter-logout-button.js +51 -0
- package/dist/components/u-newsletter-logout-button.js.map +1 -0
- package/dist/components/u-newsletter-preference-checkbox.js +124 -0
- package/dist/components/u-newsletter-preference-checkbox.js.map +1 -0
- package/dist/components/u-newsletter-resend-doi-button.js +70 -0
- package/dist/components/u-newsletter-resend-doi-button.js.map +1 -0
- package/dist/components/u-newsletter-root.js +90 -0
- package/dist/components/u-newsletter-root.js.map +1 -0
- package/dist/components/u-newsletter-toggle-subscription-button.js +97 -0
- package/dist/components/u-newsletter-toggle-subscription-button.js.map +1 -0
- package/dist/components/u-pagination-button.js +86 -0
- package/dist/components/u-pagination-button.js.map +1 -0
- package/dist/components/u-pagination-page.js +66 -0
- package/dist/components/u-pagination-page.js.map +1 -0
- package/dist/components/u-passkey.js +65 -0
- package/dist/components/u-passkey.js.map +1 -0
- package/dist/components/u-password-field.js +125 -0
- package/dist/components/u-password-field.js.map +1 -0
- package/dist/components/u-profile.js +9 -0
- package/dist/components/u-profile.js.map +1 -0
- package/dist/components/u-raw-field.js +9 -0
- package/dist/components/u-raw-field.js.map +1 -0
- package/dist/components/u-registration-button.js +70 -0
- package/dist/components/u-registration-button.js.map +1 -0
- package/dist/components/u-reset-password-button.js +63 -0
- package/dist/components/u-reset-password-button.js.map +1 -0
- package/dist/components/u-send-magic-code-button.js +85 -0
- package/dist/components/u-send-magic-code-button.js.map +1 -0
- package/dist/components/u-signed-in.js +44 -0
- package/dist/components/u-signed-in.js.map +1 -0
- package/dist/components/u-signin-root.js +63 -0
- package/dist/components/u-signin-root.js.map +1 -0
- package/dist/components/u-signin-step.js +84 -0
- package/dist/components/u-signin-step.js.map +1 -0
- package/dist/components/u-signin-strategy.js +50 -0
- package/dist/components/u-signin-strategy.js.map +1 -0
- package/dist/components/u-social-login-button.js +125 -0
- package/dist/components/u-social-login-button.js.map +1 -0
- package/dist/components/u-spinner.js +9 -0
- package/dist/components/u-spinner.js.map +1 -0
- package/dist/components/u-submit-button.js +9 -0
- package/dist/components/u-submit-button.js.map +1 -0
- package/dist/components/u-ticketable-list.js +6122 -0
- package/dist/components/u-ticketable-list.js.map +1 -0
- package/dist/{sdk/unidy-store-BwZym11Y.js → components/unidy-store.js} +3 -4
- package/dist/components/unidy-store.js.map +1 -0
- package/dist/esm/app-globals-CPU9ZcqZ.js +8 -0
- package/dist/esm/app-globals-CPU9ZcqZ.js.map +1 -0
- package/dist/{sdk/auth-Che07PeV.js → esm/auth-nsjRdpvS.js} +40 -32
- package/dist/esm/auth-nsjRdpvS.js.map +1 -0
- package/dist/esm/auth-store-CVvBlKGv.js +180 -0
- package/dist/esm/auth-store-CVvBlKGv.js.map +1 -0
- package/dist/esm/flash-store-CEvWSG0c.js +47 -0
- package/dist/{sdk/flash-store-DNcSEn2p.js.map → esm/flash-store-CEvWSG0c.js.map} +1 -1
- package/dist/esm/i18n-CLdWzy5J.js +3233 -0
- package/dist/esm/i18n-CLdWzy5J.js.map +1 -0
- package/dist/esm/index-Bjp1XO-f.js +212 -0
- package/dist/{sdk/index-BnBstyfp.js.map → esm/index-Bjp1XO-f.js.map} +1 -1
- package/dist/esm/index-Ci3aTmzp.js +12007 -0
- package/dist/esm/index-Ci3aTmzp.js.map +1 -0
- package/dist/esm/index-DSDkaHWI.js +5254 -0
- package/dist/esm/index-DSDkaHWI.js.map +1 -0
- package/dist/esm/index.js +40 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +12 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/newsletter-helpers-Dc_24im3.js +278 -0
- package/dist/esm/newsletter-helpers-Dc_24im3.js.map +1 -0
- package/dist/esm/newsletter-store-DBL1A203.js +34 -0
- package/dist/{sdk/newsletter-store-CvULKmsu.js.map → esm/newsletter-store-DBL1A203.js.map} +1 -1
- package/dist/esm/pagination-store-DzdJOp-n.js +14 -0
- package/dist/esm/pagination-store-DzdJOp-n.js.map +1 -0
- package/dist/esm/profile-helpers-CglNd6Nw.js +36 -0
- package/dist/{sdk/profile-helpers-Bs3aj0CO.js.map → esm/profile-helpers-CglNd6Nw.js.map} +1 -1
- package/dist/esm/profile-store-RmZB2PTc.js +18 -0
- package/dist/{sdk/profile-store-DD6sq42i.js.map → esm/profile-store-RmZB2PTc.js.map} +1 -1
- package/dist/esm/sdk.js +22 -0
- package/dist/esm/sdk.js.map +1 -0
- package/dist/{sdk → esm}/u-conditional-render.entry.js +12 -12
- package/dist/esm/u-conditional-render.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-config.entry.js +12 -13
- package/dist/esm/u-config.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-email-field.entry.js +7 -7
- package/dist/esm/u-email-field.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-error-message.entry.js +7 -7
- package/dist/esm/u-error-message.entry.js.map +1 -0
- package/dist/esm/u-field.u-raw-field.entry.js.map +1 -0
- package/dist/esm/u-field_2.entry.js +372 -0
- package/dist/{sdk → esm}/u-flash-message.entry.js +4 -4
- package/dist/esm/u-flash-message.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-full-profile.entry.js +7 -7
- package/dist/esm/u-full-profile.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-logout-button.entry.js +11 -11
- package/dist/esm/u-logout-button.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-magic-code-field.entry.js +10 -10
- package/dist/esm/u-magic-code-field.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-missing-field.entry.js +5 -5
- package/dist/esm/u-missing-field.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-missing-fields-submit-button.entry.js +9 -9
- package/dist/esm/u-missing-fields-submit-button.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-newsletter-checkbox.entry.js +12 -12
- package/dist/esm/u-newsletter-checkbox.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-newsletter-logout-button.entry.js +12 -12
- package/dist/esm/u-newsletter-logout-button.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-newsletter-preference-checkbox.entry.js +12 -12
- package/dist/esm/u-newsletter-preference-checkbox.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-newsletter-resend-doi-button.entry.js +12 -12
- package/dist/esm/u-newsletter-resend-doi-button.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-newsletter-root.entry.js +12 -12
- package/dist/esm/u-newsletter-root.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-newsletter-toggle-subscription-button.entry.js +12 -12
- package/dist/esm/u-newsletter-toggle-subscription-button.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-pagination-button.entry.js +2 -2
- package/dist/esm/u-pagination-button.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-pagination-page.entry.js +2 -2
- package/dist/esm/u-pagination-page.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-passkey.entry.js +10 -10
- package/dist/esm/u-passkey.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-password-field.entry.js +6 -6
- package/dist/esm/u-password-field.entry.js.map +1 -0
- package/dist/esm/u-profile.u-submit-button.entry.js.map +1 -0
- package/dist/esm/u-profile_2.entry.js +324 -0
- package/dist/{sdk → esm}/u-registration-button.entry.js +6 -6
- package/dist/esm/u-registration-button.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-reset-password-button.entry.js +10 -10
- package/dist/esm/u-reset-password-button.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-send-magic-code-button.entry.js +10 -10
- package/dist/esm/u-send-magic-code-button.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-signed-in.entry.js +5 -5
- package/dist/esm/u-signed-in.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-signin-root.entry.js +7 -7
- package/dist/esm/u-signin-root.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-signin-step.entry.js +10 -11
- package/dist/esm/u-signin-step.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-signin-strategy.entry.js +5 -5
- package/dist/esm/u-signin-strategy.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-social-login-button.entry.js +6 -6
- package/dist/esm/u-social-login-button.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-spinner.entry.js +3 -3
- package/dist/esm/u-spinner.entry.js.map +1 -0
- package/dist/{sdk → esm}/u-ticketable-list.entry.js +84 -143
- package/dist/esm/u-ticketable-list.entry.js.map +1 -0
- package/dist/esm/unidy-store-BldTAtO0.js +37 -0
- package/dist/{sdk/unidy-store-BwZym11Y.js.map → esm/unidy-store-BldTAtO0.js.map} +1 -1
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/sdk/index.esm.js +2 -22
- package/dist/sdk/index.esm.js.map +1 -1
- package/dist/sdk/loader.esm.js.map +1 -1
- package/dist/sdk/locales/de.json +1 -0
- package/dist/sdk/locales/en.json +1 -0
- package/dist/sdk/locales/fr.json +1 -0
- package/dist/sdk/locales/it.json +1 -0
- package/dist/sdk/locales/nl_be.json +1 -0
- package/dist/sdk/locales/ro.json +1 -0
- package/dist/sdk/p-0ab98e7a.entry.js +2 -0
- package/dist/sdk/p-0ab98e7a.entry.js.map +1 -0
- package/dist/sdk/p-0d324822.entry.js +2 -0
- package/dist/sdk/p-0d324822.entry.js.map +1 -0
- package/dist/sdk/p-0fb37ee9.entry.js +2 -0
- package/dist/sdk/p-0fb37ee9.entry.js.map +1 -0
- package/dist/sdk/p-2cb6a2d0.entry.js +2 -0
- package/dist/sdk/p-2cb6a2d0.entry.js.map +1 -0
- package/dist/sdk/p-3049e73f.entry.js +2 -0
- package/dist/sdk/p-3049e73f.entry.js.map +1 -0
- package/dist/sdk/p-312b919e.entry.js +2 -0
- package/dist/sdk/p-312b919e.entry.js.map +1 -0
- package/dist/sdk/p-319c5d3b.entry.js +2 -0
- package/dist/sdk/p-319c5d3b.entry.js.map +1 -0
- package/dist/sdk/p-34b98f55.entry.js +2 -0
- package/dist/sdk/p-34b98f55.entry.js.map +1 -0
- package/dist/sdk/p-39b61f33.entry.js +2 -0
- package/dist/sdk/p-39b61f33.entry.js.map +1 -0
- package/dist/sdk/p-4ec3302d.entry.js +2 -0
- package/dist/sdk/p-4ec3302d.entry.js.map +1 -0
- package/dist/sdk/p-568eabbc.entry.js +2 -0
- package/dist/sdk/p-568eabbc.entry.js.map +1 -0
- package/dist/sdk/p-5b40a68b.entry.js +2 -0
- package/dist/sdk/p-5b40a68b.entry.js.map +1 -0
- package/dist/sdk/p-5babee6b.entry.js +2 -0
- package/dist/sdk/p-5babee6b.entry.js.map +1 -0
- package/dist/sdk/p-66587fdd.entry.js +2 -0
- package/dist/sdk/p-66587fdd.entry.js.map +1 -0
- package/dist/sdk/p-6893d167.entry.js +2 -0
- package/dist/sdk/p-6893d167.entry.js.map +1 -0
- package/dist/sdk/p-73c2ec89.entry.js +2 -0
- package/dist/sdk/p-73c2ec89.entry.js.map +1 -0
- package/dist/sdk/p-80034205.entry.js +2 -0
- package/dist/sdk/p-80034205.entry.js.map +1 -0
- package/dist/sdk/p-88d93d64.entry.js +2 -0
- package/dist/sdk/p-88d93d64.entry.js.map +1 -0
- package/dist/sdk/p-90e2253e.entry.js +2 -0
- package/dist/sdk/p-90e2253e.entry.js.map +1 -0
- package/dist/sdk/p-9e71a36c.entry.js +2 -0
- package/dist/sdk/p-9e71a36c.entry.js.map +1 -0
- package/dist/sdk/p-BZ1kW_eK.js +2 -0
- package/dist/sdk/p-BZ1kW_eK.js.map +1 -0
- package/dist/sdk/p-BiILQPdb.js +2 -0
- package/dist/sdk/p-BiILQPdb.js.map +1 -0
- package/dist/sdk/p-BlOjABPD.js +2 -0
- package/dist/sdk/p-BlOjABPD.js.map +1 -0
- package/dist/sdk/p-BqFCd65h.js +2 -0
- package/dist/sdk/p-BqFCd65h.js.map +1 -0
- package/dist/sdk/p-C0feI0p8.js +2 -0
- package/dist/sdk/p-C0feI0p8.js.map +1 -0
- package/dist/sdk/p-CFiZLMAA.js +2 -0
- package/dist/sdk/p-CFiZLMAA.js.map +1 -0
- package/dist/sdk/p-CPPYdoIv.js +2 -0
- package/dist/sdk/p-CPPYdoIv.js.map +1 -0
- package/dist/sdk/p-CbRhHGU5.js +2 -0
- package/dist/sdk/p-CbRhHGU5.js.map +1 -0
- package/dist/sdk/p-Ce8zGAi1.js +2 -0
- package/dist/sdk/p-Ce8zGAi1.js.map +1 -0
- package/dist/sdk/p-Ci3aTmzp.js +3 -0
- package/dist/sdk/p-Ci3aTmzp.js.map +1 -0
- package/dist/sdk/p-D1lzXl_Z.js +2 -0
- package/dist/sdk/p-D1lzXl_Z.js.map +1 -0
- package/dist/sdk/p-DA84OuuU.js +2 -0
- package/dist/sdk/p-DA84OuuU.js.map +1 -0
- package/dist/sdk/p-DUHc_Cx7.js +2 -0
- package/dist/sdk/p-DUHc_Cx7.js.map +1 -0
- package/dist/sdk/p-DYtgart8.js +2 -0
- package/dist/sdk/p-DYtgart8.js.map +1 -0
- package/dist/sdk/p-DdUvQelg.js +2 -0
- package/dist/sdk/p-DdUvQelg.js.map +1 -0
- package/dist/sdk/p-PKvQIsOt.js +2 -0
- package/dist/sdk/p-PKvQIsOt.js.map +1 -0
- package/dist/sdk/p-a4f5940f.entry.js +2 -0
- package/dist/sdk/p-a4f5940f.entry.js.map +1 -0
- package/dist/sdk/p-a69b83ec.entry.js +2 -0
- package/dist/sdk/p-a69b83ec.entry.js.map +1 -0
- package/dist/sdk/p-aMrLKr2m.js +2 -0
- package/dist/sdk/p-aMrLKr2m.js.map +1 -0
- package/dist/sdk/p-bfb04b17.entry.js +2 -0
- package/dist/sdk/p-bfb04b17.entry.js.map +1 -0
- package/dist/sdk/p-c6816542.entry.js +2 -0
- package/dist/sdk/p-c6816542.entry.js.map +1 -0
- package/dist/sdk/p-da363474.entry.js +2 -0
- package/dist/sdk/p-da363474.entry.js.map +1 -0
- package/dist/sdk/p-e2e7061b.entry.js +2 -0
- package/dist/sdk/p-e2e7061b.entry.js.map +1 -0
- package/dist/sdk/p-e3f28800.entry.js +2 -0
- package/dist/sdk/p-e3f28800.entry.js.map +1 -0
- package/dist/sdk/p-e54d5d38.entry.js +2 -0
- package/dist/sdk/p-e54d5d38.entry.js.map +1 -0
- package/dist/sdk/p-e81bbd62.entry.js +2 -0
- package/dist/sdk/p-e81bbd62.entry.js.map +1 -0
- package/dist/sdk/p-effaf86b.entry.js +2 -0
- package/dist/sdk/p-effaf86b.entry.js.map +1 -0
- package/dist/sdk/p-f232929b.entry.js +2 -0
- package/dist/sdk/p-f232929b.entry.js.map +1 -0
- package/dist/sdk/p-f961fbea.entry.js +2 -0
- package/dist/sdk/p-f961fbea.entry.js.map +1 -0
- package/dist/sdk/sdk.esm.js +2 -48
- package/dist/sdk/sdk.esm.js.map +1 -1
- package/dist/sdk/u-config.entry.esm.js.map +1 -1
- package/dist/sdk/u-error-message.entry.esm.js.map +1 -1
- package/dist/sdk/u-field.u-raw-field.entry.esm.js.map +1 -0
- package/dist/sdk/u-full-profile.entry.esm.js.map +1 -1
- package/dist/sdk/u-magic-code-field.entry.esm.js.map +1 -1
- package/dist/sdk/u-profile.u-submit-button.entry.esm.js.map +1 -0
- package/dist/sdk/u-signin-step.entry.esm.js.map +1 -1
- package/dist/sdk/u-spinner.entry.esm.js.map +1 -1
- package/dist/sdk/u-ticketable-list.entry.esm.js.map +1 -1
- package/dist/types/auth/api/auth.d.ts +27 -27
- package/dist/types/auth/auth-helpers.d.ts +55 -54
- package/dist/types/auth/store/auth-store.d.ts +3 -3
- package/dist/types/components.d.ts +72 -0
- package/dist/types/profile/api/profile.d.ts +3 -3
- package/dist/types/profile/components/profile/profile.d.ts +15 -0
- package/dist/types/shared/components/error-message/error-message.d.ts +1 -1
- package/dist/types/ticketable/components/ticketable-list/ticketable-list.d.ts +12 -2
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +1 -1
- package/dist/sdk/auth-Che07PeV.js.map +0 -1
- package/dist/sdk/auth-store-CapiC8gJ.js.map +0 -1
- package/dist/sdk/i18n-BCI_ARJL.js.map +0 -1
- package/dist/sdk/index-BqL27K_R.js +0 -49640
- package/dist/sdk/index-BqL27K_R.js.map +0 -1
- package/dist/sdk/index-Cz3idqu9.js.map +0 -1
- package/dist/sdk/index-gEcJztft.js +0 -15349
- package/dist/sdk/index-gEcJztft.js.map +0 -1
- package/dist/sdk/newsletter-helpers-DEXEBD0F.js.map +0 -1
- package/dist/sdk/u-field.entry.esm.js.map +0 -1
- package/dist/sdk/u-profile.entry.esm.js.map +0 -1
- package/dist/sdk/u-raw-field.entry.esm.js.map +0 -1
- package/dist/sdk/u-submit-button.entry.esm.js.map +0 -1
- /package/dist/{sdk → esm}/component-utils-D1lzXl_Z.js +0 -0
- /package/dist/{sdk → esm}/component-utils-D1lzXl_Z.js.map +0 -0
- /package/dist/{sdk → esm}/helpers-BqFCd65h.js +0 -0
- /package/dist/{sdk → esm}/helpers-BqFCd65h.js.map +0 -0
- /package/dist/{sdk → esm}/helpers-DUHc_Cx7.js +0 -0
- /package/dist/{sdk → esm}/helpers-DUHc_Cx7.js.map +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-globals-DSKjcXX_.js","sources":["@stencil/core/internal/app-globals"],"sourcesContent":["import appGlobalScript from '/Users/coki/Projects/unidy.io/unidy-sdk/packages/sdk/src/globalScript.ts';\nexport const globalScripts = appGlobalScript;\nexport const globalStyles = \"\";\n"],"names":["appGlobalScript"],"mappings":";;;;AACY,MAAC,aAAa,GAAGA;;;;"}
|
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var authStore = require('./auth-store-BaxuIp4z.js');
|
|
4
|
+
var i18n = require('./i18n-BoDZ8kd2.js');
|
|
5
|
+
var index = require('./index-B_N5xKgH.js');
|
|
6
|
+
var profileStore = require('./profile-store-P_BcYkef.js');
|
|
7
|
+
var componentUtils = require('./component-utils-BpMyeVQo.js');
|
|
8
|
+
var flashStore = require('./flash-store-BuIBuQDx.js');
|
|
9
|
+
var unidyStore = require('./unidy-store-7AbWnZ6g.js');
|
|
10
|
+
var index$1 = require('./index-R2MKLaem.js');
|
|
11
|
+
|
|
12
|
+
class InvalidTokenError extends Error {
|
|
13
|
+
}
|
|
14
|
+
InvalidTokenError.prototype.name = "InvalidTokenError";
|
|
15
|
+
function b64DecodeUnicode(str) {
|
|
16
|
+
return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {
|
|
17
|
+
let code = p.charCodeAt(0).toString(16).toUpperCase();
|
|
18
|
+
if (code.length < 2) {
|
|
19
|
+
code = "0" + code;
|
|
20
|
+
}
|
|
21
|
+
return "%" + code;
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
function base64UrlDecode(str) {
|
|
25
|
+
let output = str.replace(/-/g, "+").replace(/_/g, "/");
|
|
26
|
+
switch (output.length % 4) {
|
|
27
|
+
case 0:
|
|
28
|
+
break;
|
|
29
|
+
case 2:
|
|
30
|
+
output += "==";
|
|
31
|
+
break;
|
|
32
|
+
case 3:
|
|
33
|
+
output += "=";
|
|
34
|
+
break;
|
|
35
|
+
default:
|
|
36
|
+
throw new Error("base64 string is not of the correct length");
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
return b64DecodeUnicode(output);
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
return atob(output);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function jwtDecode(token, options) {
|
|
46
|
+
if (typeof token !== "string") {
|
|
47
|
+
throw new InvalidTokenError("Invalid token specified: must be a string");
|
|
48
|
+
}
|
|
49
|
+
options || (options = {});
|
|
50
|
+
const pos = options.header === true ? 0 : 1;
|
|
51
|
+
const part = token.split(".")[pos];
|
|
52
|
+
if (typeof part !== "string") {
|
|
53
|
+
throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);
|
|
54
|
+
}
|
|
55
|
+
let decoded;
|
|
56
|
+
try {
|
|
57
|
+
decoded = base64UrlDecode(part);
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
return JSON.parse(decoded);
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const logger = index.createLogger("PasskeyAuth");
|
|
71
|
+
const PASSKEY_ERRORS = {
|
|
72
|
+
NotSupportedError: "passkey_not_supported",
|
|
73
|
+
NotAllowedError: "passkey_cancelled",
|
|
74
|
+
SecurityError: "passkey_security_error",
|
|
75
|
+
InvalidStateError: "passkey_invalid_state",
|
|
76
|
+
};
|
|
77
|
+
function decodeBase64Url(base64url) {
|
|
78
|
+
const base64 = base64url.replace(/-/g, "+").replace(/_/g, "/");
|
|
79
|
+
const padded = base64 + "=".repeat((4 - (base64.length % 4)) % 4);
|
|
80
|
+
return Uint8Array.from(atob(padded), (c) => c.charCodeAt(0));
|
|
81
|
+
}
|
|
82
|
+
function buildPublicKeyOptions(options) {
|
|
83
|
+
return {
|
|
84
|
+
challenge: Uint8Array.from(atob(options.challenge), (c) => c.charCodeAt(0)),
|
|
85
|
+
timeout: options.timeout || 60000,
|
|
86
|
+
rpId: options.rpId,
|
|
87
|
+
userVerification: options.userVerification || "required",
|
|
88
|
+
allowCredentials: options.allowCredentials?.map((cred) => ({
|
|
89
|
+
...cred,
|
|
90
|
+
id: decodeBase64Url(cred.id),
|
|
91
|
+
})),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function formatCredentialForServer(credential) {
|
|
95
|
+
const response = credential.response;
|
|
96
|
+
return {
|
|
97
|
+
id: credential.id,
|
|
98
|
+
rawId: btoa(String.fromCharCode(...new Uint8Array(credential.rawId))),
|
|
99
|
+
response: {
|
|
100
|
+
authenticatorData: btoa(String.fromCharCode(...new Uint8Array(response.authenticatorData))),
|
|
101
|
+
clientDataJSON: btoa(String.fromCharCode(...new Uint8Array(response.clientDataJSON))),
|
|
102
|
+
signature: btoa(String.fromCharCode(...new Uint8Array(response.signature))),
|
|
103
|
+
},
|
|
104
|
+
type: credential.type,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function extractAndSetSignInId(tokenResponse) {
|
|
108
|
+
if (tokenResponse.sid) {
|
|
109
|
+
authStore.authStore.setSignInId(tokenResponse.sid);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
// Fallback: extract sid from JWT token payload
|
|
113
|
+
try {
|
|
114
|
+
const decoded = jwtDecode(tokenResponse.jwt);
|
|
115
|
+
if (decoded.sid) {
|
|
116
|
+
authStore.authStore.setSignInId(decoded.sid);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch {
|
|
120
|
+
// Failed to decode JWT token to extract sid, continue without it
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function handlePasskeyError(error) {
|
|
124
|
+
logger.error("Passkey error:", error);
|
|
125
|
+
let errorMessage = "passkey_error";
|
|
126
|
+
if (error instanceof DOMException) {
|
|
127
|
+
errorMessage = PASSKEY_ERRORS[error.name] || "passkey_error";
|
|
128
|
+
}
|
|
129
|
+
authStore.authStore.setFieldError("passkey", errorMessage);
|
|
130
|
+
authStore.authStore.setLoading(false);
|
|
131
|
+
}
|
|
132
|
+
async function authenticateWithPasskey(client, onSuccess) {
|
|
133
|
+
authStore.authStore.setLoading(true);
|
|
134
|
+
authStore.authStore.clearErrors();
|
|
135
|
+
if (!window.PublicKeyCredential) {
|
|
136
|
+
authStore.authStore.setFieldError("passkey", "passkey_not_supported");
|
|
137
|
+
authStore.authStore.setLoading(false);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
try {
|
|
141
|
+
const [optionsError, options] = await client.auth.getPasskeyOptions(authStore.state.sid || undefined);
|
|
142
|
+
if (optionsError || !options) {
|
|
143
|
+
authStore.authStore.setFieldError("passkey", optionsError || "bad_request");
|
|
144
|
+
authStore.authStore.setLoading(false);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const publicKeyOptions = buildPublicKeyOptions(options);
|
|
148
|
+
const credential = (await navigator.credentials.get({
|
|
149
|
+
publicKey: publicKeyOptions,
|
|
150
|
+
}));
|
|
151
|
+
if (!credential) {
|
|
152
|
+
authStore.authStore.setFieldError("passkey", "passkey_cancelled");
|
|
153
|
+
authStore.authStore.setLoading(false);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const formattedCredential = formatCredentialForServer(credential);
|
|
157
|
+
const [verifyError, tkResponse] = await client.auth.authenticateWithPasskey(formattedCredential);
|
|
158
|
+
const tokenResponse = tkResponse;
|
|
159
|
+
if (verifyError || !tokenResponse) {
|
|
160
|
+
authStore.authStore.setGlobalError("auth", verifyError || "authentication_failed");
|
|
161
|
+
authStore.authStore.setLoading(false);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
authStore.authStore.setToken(tokenResponse.jwt);
|
|
165
|
+
extractAndSetSignInId(tokenResponse);
|
|
166
|
+
onSuccess(tokenResponse);
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
handlePasskeyError(error);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
class AuthHelpers {
|
|
174
|
+
client;
|
|
175
|
+
logger = index.createLogger("AuthHelpers");
|
|
176
|
+
static PASSWORD_ERROR_IDENTIFIERS = [
|
|
177
|
+
"invalid_password",
|
|
178
|
+
"password_required",
|
|
179
|
+
"password_not_set",
|
|
180
|
+
"passwords_do_not_match",
|
|
181
|
+
];
|
|
182
|
+
constructor(client) {
|
|
183
|
+
this.client = client;
|
|
184
|
+
}
|
|
185
|
+
async createSignIn(email, password, sendMagicCode) {
|
|
186
|
+
if (!email) {
|
|
187
|
+
throw new Error(i18n.t("errors.required_field", { field: "Email" }));
|
|
188
|
+
}
|
|
189
|
+
authStore.authStore.setLoading(true);
|
|
190
|
+
authStore.authStore.clearErrors();
|
|
191
|
+
const [error, response] = await this.client.auth.createSignIn(email, password, sendMagicCode);
|
|
192
|
+
if (error) {
|
|
193
|
+
this.handleAuthError(error, response);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (password) {
|
|
197
|
+
const token = jwtDecode(response.jwt);
|
|
198
|
+
authStore.authStore.setSignInId(token.sid);
|
|
199
|
+
authStore.authStore.setToken(response.jwt);
|
|
200
|
+
authStore.authStore.setLoading(false);
|
|
201
|
+
authStore.authStore.getRootComponentRef()?.onAuth(response);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (sendMagicCode) {
|
|
205
|
+
authStore.authStore.setSignInId(response.sid);
|
|
206
|
+
authStore.authStore.setMagicCodeStep("sent");
|
|
207
|
+
authStore.authStore.setStep("magic-code");
|
|
208
|
+
authStore.authStore.setLoading(false);
|
|
209
|
+
return [error, response];
|
|
210
|
+
}
|
|
211
|
+
const signInResponse = response;
|
|
212
|
+
authStore.authStore.setStep("verification");
|
|
213
|
+
authStore.authStore.setEmail(email);
|
|
214
|
+
authStore.authStore.setSignInId(signInResponse.sid);
|
|
215
|
+
authStore.authStore.setLoginOptions(signInResponse.login_options);
|
|
216
|
+
authStore.authStore.setLoading(false);
|
|
217
|
+
}
|
|
218
|
+
async authenticateWithPassword(password) {
|
|
219
|
+
if (!authStore.state.sid) {
|
|
220
|
+
throw new Error(i18n.t("errors.no_sign_in_id"));
|
|
221
|
+
}
|
|
222
|
+
if (!password) {
|
|
223
|
+
throw new Error(i18n.t("errors.required_field", { field: "Password" }));
|
|
224
|
+
}
|
|
225
|
+
authStore.authStore.setLoading(true);
|
|
226
|
+
authStore.authStore.clearErrors();
|
|
227
|
+
const [error, response] = await this.client.auth.authenticateWithPassword(authStore.state.sid, password);
|
|
228
|
+
if (error) {
|
|
229
|
+
this.handleAuthError(error, response);
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
authStore.authStore.setLoading(false);
|
|
233
|
+
this.handleAuthSuccess(response);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
handleAuthError(error, response) {
|
|
238
|
+
switch (error) {
|
|
239
|
+
case "account_not_found":
|
|
240
|
+
authStore.authStore.setFieldError("email", error);
|
|
241
|
+
break;
|
|
242
|
+
case "missing_required_fields": {
|
|
243
|
+
authStore.authStore.setMissingFields(response.fields);
|
|
244
|
+
profileStore.state.data = response.fields;
|
|
245
|
+
if (response.sid) {
|
|
246
|
+
authStore.authStore.setSignInId(response.sid);
|
|
247
|
+
}
|
|
248
|
+
authStore.authStore.setStep("missing-fields");
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
default:
|
|
252
|
+
if (AuthHelpers.PASSWORD_ERROR_IDENTIFIERS.includes(error)) {
|
|
253
|
+
authStore.authStore.setFieldError("password", error);
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
// e.g. "account_locked", "internal_server_error"
|
|
257
|
+
authStore.authStore.setGlobalError("auth", error);
|
|
258
|
+
}
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
authStore.authStore.setLoading(false);
|
|
262
|
+
}
|
|
263
|
+
async logout() {
|
|
264
|
+
const [error, _] = await this.client.auth.signOut(authStore.state.sid);
|
|
265
|
+
if (error) {
|
|
266
|
+
authStore.authStore.setGlobalError("auth", error);
|
|
267
|
+
}
|
|
268
|
+
return [error, _];
|
|
269
|
+
}
|
|
270
|
+
async refreshToken() {
|
|
271
|
+
if (authStore.state.step === "missing-fields") {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
this.extractSignInIdFromQuery();
|
|
275
|
+
if (!authStore.state.sid) {
|
|
276
|
+
this.logger.warn("No sign-in ID in the session");
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const [error, response] = await this.client.auth.refreshToken(authStore.state.sid);
|
|
280
|
+
if (error) {
|
|
281
|
+
authStore.authStore.reset();
|
|
282
|
+
authStore.authStore.setGlobalError("auth", error);
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
authStore.authStore.setToken(response.jwt);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
handleSocialAuthRedirect() {
|
|
289
|
+
// missing required fields flow
|
|
290
|
+
const url = new URL(window.location.href);
|
|
291
|
+
const params = url.searchParams;
|
|
292
|
+
const error = params.get("error");
|
|
293
|
+
if (error !== "missing_required_fields") {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
const fieldsFromUrl = params.get("fields");
|
|
297
|
+
if (!fieldsFromUrl) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
const signInId = params.get("sid");
|
|
301
|
+
if (signInId) {
|
|
302
|
+
authStore.authStore.setSignInId(signInId);
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
try {
|
|
308
|
+
const fields = JSON.parse(fieldsFromUrl);
|
|
309
|
+
authStore.authStore.setMissingFields(fields);
|
|
310
|
+
profileStore.state.data = fields;
|
|
311
|
+
authStore.authStore.setStep("missing-fields");
|
|
312
|
+
params.delete("error");
|
|
313
|
+
params.delete("fields");
|
|
314
|
+
const cleanUrl = `${url.origin}${url.pathname}${url.hash}`;
|
|
315
|
+
window.history.replaceState(null, "", cleanUrl);
|
|
316
|
+
}
|
|
317
|
+
catch (e) {
|
|
318
|
+
this.logger.error("Failed to parse missing fields payload:", e);
|
|
319
|
+
authStore.authStore.setGlobalError("auth", "invalid_required_fields_payload");
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
async sendMagicCode() {
|
|
323
|
+
if (!authStore.state.sid && authStore.state.step !== "single-login") {
|
|
324
|
+
throw new Error(i18n.t("errors.no_sign_in_id"));
|
|
325
|
+
}
|
|
326
|
+
authStore.authStore.setMagicCodeStep("requested");
|
|
327
|
+
authStore.authStore.setLoading(true);
|
|
328
|
+
authStore.authStore.clearErrors();
|
|
329
|
+
if (authStore.state.step === "single-login") {
|
|
330
|
+
const [error, response] = await this.createSignIn(authStore.state.email, undefined, true);
|
|
331
|
+
authStore.authStore.setLoading(false);
|
|
332
|
+
return [error, response];
|
|
333
|
+
}
|
|
334
|
+
const [error, response] = await this.client.auth.sendMagicCode(authStore.state.sid);
|
|
335
|
+
authStore.authStore.setLoading(false);
|
|
336
|
+
authStore.authStore.setStep("magic-code");
|
|
337
|
+
if (!error) {
|
|
338
|
+
authStore.authStore.setMagicCodeStep("sent");
|
|
339
|
+
return [null, response];
|
|
340
|
+
}
|
|
341
|
+
authStore.authStore.setFieldError("magicCode", error);
|
|
342
|
+
if (error === "magic_code_recently_created") {
|
|
343
|
+
authStore.authStore.setMagicCodeStep("sent");
|
|
344
|
+
}
|
|
345
|
+
return [error, response];
|
|
346
|
+
}
|
|
347
|
+
async authenticateWithMagicCode(code) {
|
|
348
|
+
if (!authStore.state.sid) {
|
|
349
|
+
throw new Error(i18n.t("errors.no_sign_in_id"));
|
|
350
|
+
}
|
|
351
|
+
if (!code) {
|
|
352
|
+
throw new Error(i18n.t("errors.magic_code_is_missing"));
|
|
353
|
+
}
|
|
354
|
+
authStore.authStore.setLoading(true);
|
|
355
|
+
authStore.authStore.clearErrors();
|
|
356
|
+
const [error, response] = await this.client.auth.authenticateWithMagicCode(authStore.state.sid, code);
|
|
357
|
+
if (!error) {
|
|
358
|
+
this.handleAuthSuccess(response);
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
if (error === "missing_required_fields") {
|
|
362
|
+
this.handleMissingFields(response);
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
authStore.authStore.setLoading(false);
|
|
366
|
+
authStore.authStore.setFieldError("magicCode", error);
|
|
367
|
+
}
|
|
368
|
+
async sendResetPasswordEmail() {
|
|
369
|
+
if (!authStore.state.sid) {
|
|
370
|
+
throw new Error(i18n.t("errors.no_sign_in_id"));
|
|
371
|
+
}
|
|
372
|
+
authStore.authStore.setLoading(true);
|
|
373
|
+
authStore.authStore.setResetPasswordStep("requested");
|
|
374
|
+
const [error, _] = await this.client.auth.sendResetPasswordEmail(authStore.state.sid, window.location.href);
|
|
375
|
+
if (error) {
|
|
376
|
+
authStore.authStore.setFieldError("resetPassword", error);
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
authStore.authStore.setResetPasswordStep("sent");
|
|
380
|
+
authStore.authStore.clearErrors();
|
|
381
|
+
}
|
|
382
|
+
authStore.authStore.setLoading(false);
|
|
383
|
+
}
|
|
384
|
+
async handleResetPasswordRedirect() {
|
|
385
|
+
const url = new URL(window.location.href);
|
|
386
|
+
const params = url.searchParams;
|
|
387
|
+
const resetToken = params.get("reset_password_token");
|
|
388
|
+
if (!resetToken) {
|
|
389
|
+
return false;
|
|
390
|
+
}
|
|
391
|
+
if (authStore.state.sid) {
|
|
392
|
+
authStore.authStore.setLoading(true);
|
|
393
|
+
const [error] = await this.client.auth.validateResetPasswordToken(authStore.state.sid, resetToken);
|
|
394
|
+
if (error) {
|
|
395
|
+
authStore.authStore.setFieldError("resetPassword", error);
|
|
396
|
+
authStore.authStore.setStep("reset-password");
|
|
397
|
+
authStore.authStore.setLoading(false);
|
|
398
|
+
return false;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
authStore.authStore.setResetToken(resetToken);
|
|
402
|
+
authStore.authStore.setStep("reset-password");
|
|
403
|
+
authStore.authStore.setLoading(false);
|
|
404
|
+
return true;
|
|
405
|
+
}
|
|
406
|
+
async resetPassword() {
|
|
407
|
+
if (!authStore.state.resetPassword.token) {
|
|
408
|
+
throw new Error("No reset token available");
|
|
409
|
+
}
|
|
410
|
+
if (!authStore.state.resetPassword.newPassword) {
|
|
411
|
+
authStore.authStore.setFieldError("resetPassword", "password_required");
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
if (authStore.state.resetPassword.passwordConfirmation &&
|
|
415
|
+
authStore.state.resetPassword.newPassword !== authStore.state.resetPassword.passwordConfirmation) {
|
|
416
|
+
authStore.authStore.setFieldError("resetPassword", "passwords_do_not_match");
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
authStore.authStore.setLoading(true);
|
|
420
|
+
authStore.authStore.clearErrors();
|
|
421
|
+
const [error, response] = await this.client.auth.resetPassword(authStore.state.sid, authStore.state.resetPassword.token, authStore.state.resetPassword.newPassword, authStore.state.resetPassword.passwordConfirmation);
|
|
422
|
+
if (error) {
|
|
423
|
+
authStore.authStore.setFieldError("resetPassword", error);
|
|
424
|
+
// TODO: add proper password requirements handling --> for now this is fine
|
|
425
|
+
if (error === "invalid_password") {
|
|
426
|
+
authStore.authStore.setFieldError("password", response.error_details?.password.map((p) => i18n.t(`errors.password_requirements.${p}`)).join("\n"));
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
authStore.authStore.setStep("email");
|
|
431
|
+
authStore.authStore.updateResetPassword({
|
|
432
|
+
step: "completed",
|
|
433
|
+
token: null,
|
|
434
|
+
newPassword: "",
|
|
435
|
+
passwordConfirmation: "",
|
|
436
|
+
});
|
|
437
|
+
componentUtils.clearUrlParam("reset_password_token");
|
|
438
|
+
flashStore.Flash.success.addMessage("Password reset successfully");
|
|
439
|
+
}
|
|
440
|
+
authStore.authStore.setLoading(false);
|
|
441
|
+
}
|
|
442
|
+
authenticateWithPasskey() {
|
|
443
|
+
return authenticateWithPasskey(this.client, (response) => this.handleAuthSuccess(response));
|
|
444
|
+
}
|
|
445
|
+
extractSignInIdFromQuery() {
|
|
446
|
+
const sid = componentUtils.clearUrlParam("sid");
|
|
447
|
+
if (sid) {
|
|
448
|
+
authStore.authStore.setSignInId(sid);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
handleMissingFields(response) {
|
|
452
|
+
authStore.authStore.setMissingFields(response.fields);
|
|
453
|
+
profileStore.state.data = response.fields;
|
|
454
|
+
authStore.authStore.setStep("missing-fields");
|
|
455
|
+
authStore.authStore.setLoading(false);
|
|
456
|
+
}
|
|
457
|
+
handleAuthSuccess(response) {
|
|
458
|
+
authStore.authStore.setToken(response.jwt);
|
|
459
|
+
authStore.authStore.setLoading(false);
|
|
460
|
+
authStore.authStore.getRootComponentRef()?.onAuth(response);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
class Auth {
|
|
465
|
+
static instance;
|
|
466
|
+
helpers;
|
|
467
|
+
constructor(client) {
|
|
468
|
+
this.helpers = new AuthHelpers(client);
|
|
469
|
+
this.helpers.handleSocialAuthRedirect();
|
|
470
|
+
this.helpers.handleResetPasswordRedirect();
|
|
471
|
+
}
|
|
472
|
+
static Errors = {
|
|
473
|
+
email: {
|
|
474
|
+
NOT_FOUND: "account_not_found",
|
|
475
|
+
},
|
|
476
|
+
magicCode: {
|
|
477
|
+
RECENTLY_CREATED: "magic_code_recently_created",
|
|
478
|
+
NOT_VALID: "magic_code_not_valid",
|
|
479
|
+
EXPIRED: "magic_code_expired",
|
|
480
|
+
USED: "magic_code_used",
|
|
481
|
+
},
|
|
482
|
+
password: {
|
|
483
|
+
INVALID: "invalid_password",
|
|
484
|
+
NOT_SET: "password_not_set",
|
|
485
|
+
RESET_PASSWORD_ALREADY_SENT: "reset_password_already_sent",
|
|
486
|
+
},
|
|
487
|
+
general: {
|
|
488
|
+
ACCOUNT_LOCKED: "account_locked",
|
|
489
|
+
SIGN_IN_EXPIRED: "sign_in_expired",
|
|
490
|
+
},
|
|
491
|
+
};
|
|
492
|
+
static async getInstance() {
|
|
493
|
+
if (!Auth.isInitialized()) {
|
|
494
|
+
await unidyStore.waitForConfig();
|
|
495
|
+
return Auth.initialize(index$1.getUnidyClient());
|
|
496
|
+
}
|
|
497
|
+
return Auth.instance;
|
|
498
|
+
}
|
|
499
|
+
static initialize(client) {
|
|
500
|
+
Auth.instance = new Auth(client);
|
|
501
|
+
if (Auth.instance.isTokenValid(authStore.state.token)) {
|
|
502
|
+
authStore.authStore.setAuthenticated(true);
|
|
503
|
+
}
|
|
504
|
+
return Auth.instance;
|
|
505
|
+
}
|
|
506
|
+
static isInitialized() {
|
|
507
|
+
return !!Auth.instance;
|
|
508
|
+
}
|
|
509
|
+
isTokenValid(token) {
|
|
510
|
+
try {
|
|
511
|
+
let decoded;
|
|
512
|
+
if (typeof token === "string") {
|
|
513
|
+
decoded = jwtDecode(token);
|
|
514
|
+
}
|
|
515
|
+
else {
|
|
516
|
+
decoded = token;
|
|
517
|
+
}
|
|
518
|
+
if (!decoded)
|
|
519
|
+
return false;
|
|
520
|
+
const currentTime = Date.now() / 1000;
|
|
521
|
+
return decoded.exp > currentTime;
|
|
522
|
+
}
|
|
523
|
+
catch (error) {
|
|
524
|
+
index.captureException(error);
|
|
525
|
+
return false;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
async isAuthenticated() {
|
|
529
|
+
const token = await this.getToken();
|
|
530
|
+
return typeof token === "string";
|
|
531
|
+
}
|
|
532
|
+
async getToken() {
|
|
533
|
+
const currentToken = authStore.state.token;
|
|
534
|
+
if (currentToken && this.isTokenValid(currentToken)) {
|
|
535
|
+
return currentToken;
|
|
536
|
+
}
|
|
537
|
+
await this.helpers.refreshToken();
|
|
538
|
+
if (authStore.state.globalErrors.auth || !authStore.state.token) {
|
|
539
|
+
return this.createAuthError(i18n.t("errors.refresh_failed"), "REFRESH_FAILED", true);
|
|
540
|
+
}
|
|
541
|
+
return authStore.state.token;
|
|
542
|
+
}
|
|
543
|
+
async userData() {
|
|
544
|
+
const token = await this.getToken();
|
|
545
|
+
if (typeof token !== "string") {
|
|
546
|
+
return null;
|
|
547
|
+
}
|
|
548
|
+
if (!token) {
|
|
549
|
+
return null;
|
|
550
|
+
}
|
|
551
|
+
try {
|
|
552
|
+
return jwtDecode(token);
|
|
553
|
+
}
|
|
554
|
+
catch (error) {
|
|
555
|
+
index.captureException(error);
|
|
556
|
+
return null;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
async logout() {
|
|
560
|
+
const [error, _] = await this.helpers.logout();
|
|
561
|
+
if (error) {
|
|
562
|
+
return this.createAuthError(i18n.t("errors.sign_out_failed", { reason: error }), "SIGN_OUT_FAILED", false);
|
|
563
|
+
}
|
|
564
|
+
authStore.authStore.reset();
|
|
565
|
+
return true;
|
|
566
|
+
}
|
|
567
|
+
getEmail() {
|
|
568
|
+
return authStore.state.email;
|
|
569
|
+
}
|
|
570
|
+
createAuthError(message, code, requiresReauth = false) {
|
|
571
|
+
const error = new Error(message);
|
|
572
|
+
error.code = code;
|
|
573
|
+
error.requiresReauth = requiresReauth;
|
|
574
|
+
return error;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
exports.Auth = Auth;
|
|
579
|
+
//# sourceMappingURL=auth-NU3DBc-6.js.map
|
|
580
|
+
|
|
581
|
+
//# sourceMappingURL=auth-NU3DBc-6.js.map
|