@keycloakify/angular 0.0.1-rc.0 → 0.0.1-rc.11
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/account/DefaultPage.d.ts +38 -0
- package/account/DefaultPage.js +34 -0
- package/account/KcContext.d.ts +1 -0
- package/account/KcContext.js +2 -0
- package/account/classes/component-reference.class.d.ts +6 -0
- package/account/classes/component-reference.class.js +3 -0
- package/account/containers/template.component.d.ts +26 -0
- package/account/containers/template.component.js +66 -0
- package/account/directives/kc-class.directive.d.ts +26 -0
- package/account/directives/kc-class.directive.js +137 -0
- package/account/i18n.d.ts +4 -0
- package/account/i18n.js +2 -0
- package/account/pages/account/account.component.d.ts +14 -0
- package/account/pages/account/account.component.js +39 -0
- package/account/pages/applications/applications.component.d.ts +13 -0
- package/account/pages/applications/applications.component.js +37 -0
- package/account/pages/federatedIdentity/federatedIdentity.component.d.ts +13 -0
- package/account/pages/federatedIdentity/federatedIdentity.component.js +36 -0
- package/account/pages/log/log.component.d.ts +13 -0
- package/account/pages/log/log.component.js +36 -0
- package/account/pages/password/password.component.d.ts +28 -0
- package/account/pages/password/password.component.js +107 -0
- package/account/pages/sessions/sessions.component.d.ts +13 -0
- package/account/pages/sessions/sessions.component.js +36 -0
- package/account/pages/totp/totp.component.d.ts +13 -0
- package/account/pages/totp/totp.component.js +37 -0
- package/account/providers/keycloakify-angular.providers.d.ts +15 -0
- package/account/providers/keycloakify-angular.providers.js +48 -0
- package/account/services/i18n.service.d.ts +6 -0
- package/account/services/i18n.service.js +12 -0
- package/account/services/resource-injector.service.d.ts +10 -0
- package/account/services/resource-injector.service.js +37 -0
- package/account/tokens/classes.token.d.ts +16 -0
- package/account/tokens/classes.token.js +3 -0
- package/account/tokens/i18n.token.d.ts +2 -0
- package/account/tokens/i18n.token.js +3 -0
- package/account/tokens/kc-context.token.d.ts +3 -0
- package/account/tokens/kc-context.token.js +3 -0
- package/lib/directives/attributes.directive.d.ts +8 -0
- package/lib/directives/attributes.directive.js +26 -0
- package/lib/models/script.model.js +1 -1
- package/lib/pipes/input-type.pipe.d.ts +7 -0
- package/lib/pipes/input-type.pipe.js +20 -0
- package/lib/pipes/is-array-with-empty-object.pipe.d.ts +7 -0
- package/lib/pipes/is-array-with-empty-object.pipe.js +20 -0
- package/lib/pipes/kc-sanitize.pipe.d.ts +9 -0
- package/lib/pipes/kc-sanitize.pipe.js +29 -0
- package/lib/pipes/to-array.pipe.d.ts +7 -0
- package/lib/pipes/to-array.pipe.js +21 -0
- package/lib/pipes/to-number.pipe.d.ts +7 -0
- package/lib/pipes/to-number.pipe.js +20 -0
- package/lib/services/resource-injector.service.d.ts +5 -2
- package/lib/services/resource-injector.service.js +19 -22
- package/lib/tokens/use-default-css.token.d.ts +2 -0
- package/lib/tokens/use-default-css.token.js +3 -0
- package/login/DefaultPage.d.ts +28 -28
- package/login/DefaultPage.js +74 -74
- package/login/KcContext.d.ts +1 -1
- package/login/KcContext.js +1 -1
- package/login/classes/component-reference.class.d.ts +1 -1
- package/login/classes/component-reference.class.js +1 -1
- package/login/components/add-remove-buttons-multi-valued-attribute/add-remove-buttons-multi-valued-attribute.component.d.ts +7 -2
- package/login/components/add-remove-buttons-multi-valued-attribute/add-remove-buttons-multi-valued-attribute.component.js +19 -36
- package/login/components/field-errors/field-errors.component.d.ts +7 -4
- package/login/components/field-errors/field-errors.component.js +23 -35
- package/login/components/group-label/group-label.component.d.ts +8 -3
- package/login/components/group-label/group-label.component.js +29 -41
- package/login/components/input-field-by-type/input-field-by-type.component.d.ts +7 -4
- package/login/components/input-field-by-type/input-field-by-type.component.js +33 -50
- package/login/components/input-tag/input-tag.component.d.ts +9 -4
- package/login/components/input-tag/input-tag.component.js +47 -64
- package/login/components/input-tag-selects/input-tag-selects.component.d.ts +11 -6
- package/login/components/input-tag-selects/input-tag-selects.component.js +41 -56
- package/login/components/logout-other-sessions/logout-other-sessions.component.d.ts +7 -2
- package/login/components/logout-other-sessions/logout-other-sessions.component.js +25 -36
- package/login/components/password-wrapper/password-wrapper.component.d.ts +8 -3
- package/login/components/password-wrapper/password-wrapper.component.js +27 -38
- package/login/components/select-tag/select-tag.component.d.ts +9 -4
- package/login/components/select-tag/select-tag.component.js +32 -47
- package/login/components/textarea-tag/textarea-tag.component.d.ts +7 -4
- package/login/components/textarea-tag/textarea-tag.component.js +28 -42
- package/login/components/user-profile-form-fields/user-profile-form-fields.component.d.ts +11 -5
- package/login/components/user-profile-form-fields/user-profile-form-fields.component.js +45 -57
- package/login/containers/template.component.d.ts +11 -8
- package/login/containers/template.component.js +36 -42
- package/login/directives/kc-class.directive.d.ts +5 -2
- package/login/directives/kc-class.directive.js +35 -43
- package/login/i18n.d.ts +2 -2
- package/login/i18n.js +1 -1
- package/login/pages/code/code.component.d.ts +8 -3
- package/login/pages/code/code.component.js +28 -31
- package/login/pages/delete-account-confirm/delete-account-confirm.component.d.ts +8 -3
- package/login/pages/delete-account-confirm/delete-account-confirm.component.js +28 -31
- package/login/pages/delete-credential/delete-credential.component.d.ts +8 -3
- package/login/pages/delete-credential/delete-credential.component.js +28 -31
- package/login/pages/error/error.component.d.ts +8 -3
- package/login/pages/error/error.component.js +28 -31
- package/login/pages/frontchannel-logout/frontchannel-logout.component.d.ts +9 -4
- package/login/pages/frontchannel-logout/frontchannel-logout.component.js +28 -31
- package/login/pages/idp-review-user-profile/idp-review-user-profile.component.d.ts +13 -3
- package/login/pages/idp-review-user-profile/idp-review-user-profile.component.js +40 -41
- package/login/pages/info/info.component.d.ts +8 -9
- package/login/pages/info/info.component.js +31 -43
- package/login/pages/login/login.component.d.ts +8 -3
- package/login/pages/login/login.component.js +33 -47
- package/login/pages/login-config-totp/login-config-totp.component.d.ts +8 -3
- package/login/pages/login-config-totp/login-config-totp.component.js +31 -42
- package/login/pages/login-idp-link-confirm/login-idp-link-confirm.component.d.ts +8 -3
- package/login/pages/login-idp-link-confirm/login-idp-link-confirm.component.js +28 -31
- package/login/pages/login-idp-link-confirm-override/login-idp-link-confirm-override.component.d.ts +8 -3
- package/login/pages/login-idp-link-confirm-override/login-idp-link-confirm-override.component.js +28 -31
- package/login/pages/login-idp-link-email/login-idp-link-email.component.d.ts +8 -3
- package/login/pages/login-idp-link-email/login-idp-link-email.component.js +28 -31
- package/login/pages/login-oauth-grant/login-oauth-grant.component.d.ts +8 -3
- package/login/pages/login-oauth-grant/login-oauth-grant.component.js +29 -33
- package/login/pages/login-oauth2-device-verify-user-code/login-oauth2-device-verify-user-code.component.d.ts +8 -3
- package/login/pages/login-oauth2-device-verify-user-code/login-oauth2-device-verify-user-code.component.js +28 -31
- package/login/pages/login-otp/login-otp.component.d.ts +8 -3
- package/login/pages/login-otp/login-otp.component.js +30 -33
- package/login/pages/login-page-expired/login-page-expired.component.d.ts +8 -3
- package/login/pages/login-page-expired/login-page-expired.component.js +27 -30
- package/login/pages/login-passkeys-conditional-authenticate/login-passkeys-conditional-authenticate.component.d.ts +9 -6
- package/login/pages/login-passkeys-conditional-authenticate/login-passkeys-conditional-authenticate.component.js +37 -44
- package/login/pages/login-password/login-password.component.d.ts +8 -3
- package/login/pages/login-password/login-password.component.js +31 -40
- package/login/pages/login-recovery-authn-code-config/login-recovery-authn-code-config.component.d.ts +8 -3
- package/login/pages/login-recovery-authn-code-config/login-recovery-authn-code-config.component.js +30 -38
- package/login/pages/login-recovery-authn-code-input/login-recovery-authn-code-input.component.d.ts +8 -3
- package/login/pages/login-recovery-authn-code-input/login-recovery-authn-code-input.component.js +30 -33
- package/login/pages/login-reset-otp/login-reset-otp.component.d.ts +8 -3
- package/login/pages/login-reset-otp/login-reset-otp.component.js +29 -32
- package/login/pages/login-reset-password/login-reset-password.component.d.ts +8 -3
- package/login/pages/login-reset-password/login-reset-password.component.js +30 -33
- package/login/pages/login-update-password/login-update-password.component.d.ts +8 -3
- package/login/pages/login-update-password/login-update-password.component.js +32 -42
- package/login/pages/login-update-profile/login-update-profile.component.d.ts +13 -3
- package/login/pages/login-update-profile/login-update-profile.component.js +39 -39
- package/login/pages/login-username/login-username.component.d.ts +8 -3
- package/login/pages/login-username/login-username.component.js +32 -45
- package/login/pages/login-verify-email/login-verify-email.component.d.ts +8 -3
- package/login/pages/login-verify-email/login-verify-email.component.js +28 -31
- package/login/pages/login-x509-info/login-x509-info.component.d.ts +8 -3
- package/login/pages/login-x509-info/login-x509-info.component.js +28 -31
- package/login/pages/logout-confirm/logout-confirm.component.d.ts +8 -3
- package/login/pages/logout-confirm/logout-confirm.component.js +28 -31
- package/login/pages/register/register.component.d.ts +13 -3
- package/login/pages/register/register.component.js +41 -48
- package/login/pages/saml-post-form/saml-post-form.component.d.ts +9 -4
- package/login/pages/saml-post-form/saml-post-form.component.js +32 -35
- package/login/pages/select-authenticator/select-authenticator.component.d.ts +8 -3
- package/login/pages/select-authenticator/select-authenticator.component.js +29 -39
- package/login/pages/terms/terms.component.d.ts +8 -3
- package/login/pages/terms/terms.component.js +28 -31
- package/login/pages/update-email/update-email.component.d.ts +13 -3
- package/login/pages/update-email/update-email.component.js +40 -41
- package/login/pages/webauthn-authenticate/webauthn-authenticate.component.d.ts +9 -6
- package/login/pages/webauthn-authenticate/webauthn-authenticate.component.js +37 -50
- package/login/pages/webauthn-error/webauthn-error.component.d.ts +8 -3
- package/login/pages/webauthn-error/webauthn-error.component.js +32 -40
- package/login/pages/webauthn-register/webauthn-register.component.d.ts +9 -6
- package/login/pages/webauthn-register/webauthn-register.component.js +36 -46
- package/login/providers/keycloakify-angular.providers.d.ts +16 -0
- package/login/providers/keycloakify-angular.providers.js +53 -0
- package/login/services/i18n.service.d.ts +6 -0
- package/login/services/i18n.service.js +12 -0
- package/login/services/login-resource-injector.service.d.ts +4 -1
- package/login/services/login-resource-injector.service.js +22 -25
- package/login/services/submit.service.d.ts +9 -0
- package/login/services/submit.service.js +20 -0
- package/login/services/user-profile-form.service.d.ts +16 -12
- package/login/services/user-profile-form.service.js +293 -305
- package/{lib/providers/keycloakify-angular.providers.d.ts → login/tokens/classes.token.d.ts} +14 -37
- package/login/tokens/classes.token.js +3 -0
- package/login/tokens/i18n.token.d.ts +2 -0
- package/login/tokens/i18n.token.js +3 -0
- package/login/tokens/kc-context.token.d.ts +3 -0
- package/login/tokens/kc-context.token.js +3 -0
- package/login/tokens/make-user-confirm-password.token.d.ts +2 -0
- package/login/tokens/make-user-confirm-password.token.js +3 -0
- package/package.json +123 -181
- package/src/account/DefaultPage.ts +51 -0
- package/src/account/KcContext.ts +1 -0
- package/src/account/classes/component-reference.class.ts +6 -0
- package/src/account/containers/template.component.html +125 -0
- package/src/account/containers/template.component.ts +71 -0
- package/src/account/directives/kc-class.directive.ts +150 -0
- package/src/account/i18n.ts +4 -0
- package/src/account/pages/account/account.component.html +165 -0
- package/src/account/pages/account/account.component.ts +34 -0
- package/src/account/pages/applications/applications.component.html +156 -0
- package/src/account/pages/applications/applications.component.ts +32 -0
- package/src/account/pages/federatedIdentity/federatedIdentity.component.html +97 -0
- package/src/account/pages/federatedIdentity/federatedIdentity.component.ts +31 -0
- package/src/account/pages/log/log.component.html +44 -0
- package/src/account/pages/log/log.component.ts +31 -0
- package/src/account/pages/password/password.component.html +131 -0
- package/src/account/pages/password/password.component.ts +110 -0
- package/src/account/pages/sessions/sessions.component.html +63 -0
- package/src/account/pages/sessions/sessions.component.ts +31 -0
- package/src/account/pages/totp/totp.component.html +258 -0
- package/src/account/pages/totp/totp.component.ts +32 -0
- package/src/account/providers/keycloakify-angular.providers.ts +64 -0
- package/src/account/services/i18n.service.ts +7 -0
- package/src/account/services/resource-injector.service.ts +37 -0
- package/src/account/tokens/classes.token.ts +6 -0
- package/src/account/tokens/i18n.token.ts +3 -0
- package/src/account/tokens/kc-context.token.ts +4 -0
- package/src/{login → lib}/directives/attributes.directive.ts +2 -2
- package/src/{login → lib}/pipes/input-type.pipe.ts +4 -4
- package/src/lib/pipes/is-array-with-empty-object.pipe.ts +16 -0
- package/src/lib/pipes/kc-sanitize.pipe.ts +34 -0
- package/src/lib/pipes/to-array.pipe.ts +15 -0
- package/src/lib/pipes/to-number.pipe.ts +13 -0
- package/src/lib/services/resource-injector.service.ts +7 -7
- package/src/lib/tokens/use-default-css.token.ts +3 -0
- package/src/login/DefaultPage.ts +76 -76
- package/src/login/KcContext.ts +1 -1
- package/src/login/classes/component-reference.class.ts +1 -1
- package/src/login/components/add-remove-buttons-multi-valued-attribute/add-remove-buttons-multi-valued-attribute.component.html +19 -19
- package/src/login/components/add-remove-buttons-multi-valued-attribute/add-remove-buttons-multi-valued-attribute.component.ts +15 -23
- package/src/login/components/field-errors/field-errors.component.html +10 -10
- package/src/login/components/field-errors/field-errors.component.ts +11 -16
- package/src/login/components/group-label/group-label.component.html +25 -25
- package/src/login/components/group-label/group-label.component.ts +17 -21
- package/src/login/components/input-field-by-type/input-field-by-type.component.html +57 -57
- package/src/login/components/input-field-by-type/input-field-by-type.component.ts +18 -35
- package/src/login/components/input-tag/input-tag.component.html +41 -45
- package/src/login/components/input-tag/input-tag.component.ts +25 -34
- package/src/login/components/input-tag-selects/input-tag-selects.component.html +22 -22
- package/src/login/components/input-tag-selects/input-tag-selects.component.ts +32 -43
- package/src/login/components/logout-other-sessions/logout-other-sessions.component.html +15 -15
- package/src/login/components/logout-other-sessions/logout-other-sessions.component.ts +13 -10
- package/src/login/components/password-wrapper/password-wrapper.component.html +13 -13
- package/src/login/components/password-wrapper/password-wrapper.component.ts +15 -25
- package/src/login/components/select-tag/select-tag.component.html +26 -26
- package/src/login/components/select-tag/select-tag.component.ts +23 -35
- package/src/login/components/textarea-tag/textarea-tag.component.html +13 -15
- package/src/login/components/textarea-tag/textarea-tag.component.ts +16 -25
- package/src/login/components/user-profile-form-fields/user-profile-form-fields.component.html +70 -73
- package/src/login/components/user-profile-form-fields/user-profile-form-fields.component.ts +33 -47
- package/src/login/containers/template.component.html +183 -183
- package/src/login/containers/template.component.ts +26 -42
- package/src/login/directives/kc-class.directive.ts +11 -11
- package/src/login/i18n.ts +2 -2
- package/src/login/pages/code/code.component.html +21 -21
- package/src/login/pages/code/code.component.ts +17 -17
- package/src/login/pages/delete-account-confirm/delete-account-confirm.component.html +44 -42
- package/src/login/pages/delete-account-confirm/delete-account-confirm.component.ts +17 -18
- package/src/login/pages/delete-credential/delete-credential.component.html +29 -29
- package/src/login/pages/delete-credential/delete-credential.component.ts +17 -24
- package/src/login/pages/error/error.component.html +20 -20
- package/src/login/pages/error/error.component.ts +17 -17
- package/src/login/pages/frontchannel-logout/frontchannel-logout.component.html +31 -31
- package/src/login/pages/frontchannel-logout/frontchannel-logout.component.ts +17 -25
- package/src/login/pages/idp-review-user-profile/idp-review-user-profile.component.html +36 -36
- package/src/login/pages/idp-review-user-profile/idp-review-user-profile.component.ts +34 -33
- package/src/login/pages/info/info.component.html +45 -45
- package/src/login/pages/info/info.component.ts +20 -37
- package/src/login/pages/login/login.component.html +194 -194
- package/src/login/pages/login/login.component.ts +22 -43
- package/src/login/pages/login-config-totp/login-config-totp.component.html +189 -179
- package/src/login/pages/login-config-totp/login-config-totp.component.ts +20 -39
- package/src/login/pages/login-idp-link-confirm/login-idp-link-confirm.component.html +35 -35
- package/src/login/pages/login-idp-link-confirm/login-idp-link-confirm.component.ts +17 -24
- package/src/login/pages/login-idp-link-confirm-override/login-idp-link-confirm-override.component.html +34 -34
- package/src/login/pages/login-idp-link-confirm-override/login-idp-link-confirm-override.component.ts +17 -26
- package/src/login/pages/login-idp-link-email/login-idp-link-email.component.html +32 -30
- package/src/login/pages/login-idp-link-email/login-idp-link-email.component.ts +17 -24
- package/src/login/pages/login-oauth-grant/login-oauth-grant.component.html +83 -81
- package/src/login/pages/login-oauth-grant/login-oauth-grant.component.ts +18 -26
- package/src/login/pages/login-oauth2-device-verify-user-code/login-oauth2-device-verify-user-code.component.html +57 -57
- package/src/login/pages/login-oauth2-device-verify-user-code/login-oauth2-device-verify-user-code.component.ts +17 -26
- package/src/login/pages/login-otp/login-otp.component.html +96 -96
- package/src/login/pages/login-otp/login-otp.component.ts +19 -25
- package/src/login/pages/login-page-expired/login-page-expired.component.html +31 -31
- package/src/login/pages/login-page-expired/login-page-expired.component.ts +16 -23
- package/src/login/pages/login-passkeys-conditional-authenticate/login-passkeys-conditional-authenticate.component.html +183 -181
- package/src/login/pages/login-passkeys-conditional-authenticate/login-passkeys-conditional-authenticate.component.ts +25 -32
- package/src/login/pages/login-password/login-password.component.html +82 -82
- package/src/login/pages/login-password/login-password.component.ts +20 -33
- package/src/login/pages/login-recovery-authn-code-config/login-recovery-authn-code-config.component.html +142 -142
- package/src/login/pages/login-recovery-authn-code-config/login-recovery-authn-code-config.component.ts +19 -34
- package/src/login/pages/login-recovery-authn-code-input/login-recovery-authn-code-input.component.html +67 -67
- package/src/login/pages/login-recovery-authn-code-input/login-recovery-authn-code-input.component.ts +19 -29
- package/src/login/pages/login-reset-otp/login-reset-otp.component.html +61 -59
- package/src/login/pages/login-reset-otp/login-reset-otp.component.ts +18 -24
- package/src/login/pages/login-reset-password/login-reset-password.component.html +84 -84
- package/src/login/pages/login-reset-password/login-reset-password.component.ts +19 -26
- package/src/login/pages/login-update-password/login-update-password.component.html +107 -107
- package/src/login/pages/login-update-password/login-update-password.component.ts +21 -38
- package/src/login/pages/login-update-profile/login-update-profile.component.html +52 -53
- package/src/login/pages/login-update-profile/login-update-profile.component.ts +31 -32
- package/src/login/pages/login-username/login-username.component.html +146 -146
- package/src/login/pages/login-username/login-username.component.ts +21 -38
- package/src/login/pages/login-verify-email/login-verify-email.component.html +22 -22
- package/src/login/pages/login-verify-email/login-verify-email.component.ts +17 -24
- package/src/login/pages/login-x509-info/login-x509-info.component.html +96 -96
- package/src/login/pages/login-x509-info/login-x509-info.component.ts +17 -23
- package/src/login/pages/logout-confirm/logout-confirm.component.html +51 -51
- package/src/login/pages/logout-confirm/logout-confirm.component.ts +17 -23
- package/src/login/pages/register/register.component.html +113 -113
- package/src/login/pages/register/register.component.ts +33 -39
- package/src/login/pages/saml-post-form/saml-post-form.component.html +47 -48
- package/src/login/pages/saml-post-form/saml-post-form.component.ts +19 -27
- package/src/login/pages/select-authenticator/select-authenticator.component.html +43 -44
- package/src/login/pages/select-authenticator/select-authenticator.component.ts +18 -32
- package/src/login/pages/terms/terms.component.html +32 -32
- package/src/login/pages/terms/terms.component.ts +17 -23
- package/src/login/pages/update-email/update-email.component.html +52 -52
- package/src/login/pages/update-email/update-email.component.ts +33 -33
- package/src/login/pages/webauthn-authenticate/webauthn-authenticate.component.html +146 -148
- package/src/login/pages/webauthn-authenticate/webauthn-authenticate.component.ts +26 -50
- package/src/login/pages/webauthn-error/webauthn-error.component.html +53 -53
- package/src/login/pages/webauthn-error/webauthn-error.component.ts +21 -32
- package/src/login/pages/webauthn-register/webauthn-register.component.html +73 -73
- package/src/login/pages/webauthn-register/webauthn-register.component.ts +26 -40
- package/src/login/providers/keycloakify-angular.providers.ts +68 -0
- package/src/login/services/i18n.service.ts +7 -0
- package/src/login/services/login-resource-injector.service.ts +13 -12
- package/src/login/services/submit.service.ts +12 -0
- package/src/login/services/user-profile-form.service.ts +185 -187
- package/src/login/tokens/classes.token.ts +6 -0
- package/src/login/tokens/i18n.token.ts +3 -0
- package/src/login/tokens/kc-context.token.ts +4 -0
- package/src/login/tokens/make-user-confirm-password.token.ts +5 -0
- package/src/tsconfig.json +6 -1
- package/stories/login/pages/login/login.stories.ts +146 -0
- package/lib/i18n.d.ts +0 -4
- package/lib/i18n.js +0 -6
- package/lib/i18n.js.map +0 -1
- package/lib/models/index.d.ts +0 -1
- package/lib/models/index.js +0 -2
- package/lib/models/index.js.map +0 -1
- package/lib/models/script.model.js.map +0 -1
- package/lib/providers/keycloakify-angular.providers.js +0 -58
- package/lib/providers/keycloakify-angular.providers.js.map +0 -1
- package/lib/public-api.d.ts +0 -10
- package/lib/public-api.js +0 -4
- package/lib/public-api.js.map +0 -1
- package/lib/services/i18n.service.d.ts +0 -3
- package/lib/services/i18n.service.js +0 -14
- package/lib/services/i18n.service.js.map +0 -1
- package/lib/services/index.d.ts +0 -2
- package/lib/services/index.js +0 -3
- package/lib/services/index.js.map +0 -1
- package/lib/services/resource-injector.service.js.map +0 -1
- package/login/DefaultPage.js.map +0 -1
- package/login/KcContext.js.map +0 -1
- package/login/classes/component-reference.class.js.map +0 -1
- package/login/components/add-remove-buttons-multi-valued-attribute/add-remove-buttons-multi-valued-attribute.component.html +0 -24
- package/login/components/add-remove-buttons-multi-valued-attribute/add-remove-buttons-multi-valued-attribute.component.js.map +0 -1
- package/login/components/field-errors/field-errors.component.html +0 -15
- package/login/components/field-errors/field-errors.component.js.map +0 -1
- package/login/components/group-label/group-label.component.html +0 -30
- package/login/components/group-label/group-label.component.js.map +0 -1
- package/login/components/index.d.ts +0 -11
- package/login/components/index.js +0 -12
- package/login/components/index.js.map +0 -1
- package/login/components/input-field-by-type/input-field-by-type.component.html +0 -63
- package/login/components/input-field-by-type/input-field-by-type.component.js.map +0 -1
- package/login/components/input-tag/input-tag.component.html +0 -49
- package/login/components/input-tag/input-tag.component.js.map +0 -1
- package/login/components/input-tag-selects/input-tag-selects.component.html +0 -29
- package/login/components/input-tag-selects/input-tag-selects.component.js.map +0 -1
- package/login/components/logout-other-sessions/logout-other-sessions.component.html +0 -19
- package/login/components/logout-other-sessions/logout-other-sessions.component.js.map +0 -1
- package/login/components/password-wrapper/password-wrapper.component.html +0 -15
- package/login/components/password-wrapper/password-wrapper.component.js.map +0 -1
- package/login/components/select-tag/select-tag.component.html +0 -31
- package/login/components/select-tag/select-tag.component.js.map +0 -1
- package/login/components/textarea-tag/textarea-tag.component.html +0 -18
- package/login/components/textarea-tag/textarea-tag.component.js.map +0 -1
- package/login/components/user-profile-form-fields/user-profile-form-fields.component.html +0 -85
- package/login/components/user-profile-form-fields/user-profile-form-fields.component.js.map +0 -1
- package/login/containers/template.component.html +0 -203
- package/login/containers/template.component.js.map +0 -1
- package/login/directives/attributes.directive.d.ts +0 -5
- package/login/directives/attributes.directive.js +0 -34
- package/login/directives/attributes.directive.js.map +0 -1
- package/login/directives/index.d.ts +0 -2
- package/login/directives/index.js +0 -3
- package/login/directives/index.js.map +0 -1
- package/login/directives/kc-class.directive.js.map +0 -1
- package/login/i18n.js.map +0 -1
- package/login/pages/code/code.component.html +0 -26
- package/login/pages/code/code.component.js.map +0 -1
- package/login/pages/delete-account-confirm/delete-account-confirm.component.html +0 -46
- package/login/pages/delete-account-confirm/delete-account-confirm.component.js.map +0 -1
- package/login/pages/delete-credential/delete-credential.component.html +0 -35
- package/login/pages/delete-credential/delete-credential.component.js.map +0 -1
- package/login/pages/error/error.component.html +0 -25
- package/login/pages/error/error.component.js.map +0 -1
- package/login/pages/frontchannel-logout/frontchannel-logout.component.html +0 -35
- package/login/pages/frontchannel-logout/frontchannel-logout.component.js.map +0 -1
- package/login/pages/idp-review-user-profile/idp-review-user-profile.component.html +0 -41
- package/login/pages/idp-review-user-profile/idp-review-user-profile.component.js.map +0 -1
- package/login/pages/info/info.component.html +0 -54
- package/login/pages/info/info.component.js.map +0 -1
- package/login/pages/login/login.component.html +0 -212
- package/login/pages/login/login.component.js.map +0 -1
- package/login/pages/login-config-totp/login-config-totp.component.html +0 -190
- package/login/pages/login-config-totp/login-config-totp.component.js.map +0 -1
- package/login/pages/login-idp-link-confirm/login-idp-link-confirm.component.html +0 -41
- package/login/pages/login-idp-link-confirm/login-idp-link-confirm.component.js.map +0 -1
- package/login/pages/login-idp-link-confirm-override/login-idp-link-confirm-override.component.html +0 -40
- package/login/pages/login-idp-link-confirm-override/login-idp-link-confirm-override.component.js.map +0 -1
- package/login/pages/login-idp-link-email/login-idp-link-email.component.html +0 -37
- package/login/pages/login-idp-link-email/login-idp-link-email.component.js.map +0 -1
- package/login/pages/login-oauth-grant/login-oauth-grant.component.html +0 -92
- package/login/pages/login-oauth-grant/login-oauth-grant.component.js.map +0 -1
- package/login/pages/login-oauth2-device-verify-user-code/login-oauth2-device-verify-user-code.component.html +0 -63
- package/login/pages/login-oauth2-device-verify-user-code/login-oauth2-device-verify-user-code.component.js.map +0 -1
- package/login/pages/login-otp/login-otp.component.html +0 -103
- package/login/pages/login-otp/login-otp.component.js.map +0 -1
- package/login/pages/login-page-expired/login-page-expired.component.html +0 -35
- package/login/pages/login-page-expired/login-page-expired.component.js.map +0 -1
- package/login/pages/login-passkeys-conditional-authenticate/login-passkeys-conditional-authenticate.component.html +0 -203
- package/login/pages/login-passkeys-conditional-authenticate/login-passkeys-conditional-authenticate.component.js.map +0 -1
- package/login/pages/login-password/login-password.component.html +0 -90
- package/login/pages/login-password/login-password.component.js.map +0 -1
- package/login/pages/login-recovery-authn-code-config/login-recovery-authn-code-config.component.html +0 -155
- package/login/pages/login-recovery-authn-code-config/login-recovery-authn-code-config.component.js.map +0 -1
- package/login/pages/login-recovery-authn-code-input/login-recovery-authn-code-input.component.html +0 -76
- package/login/pages/login-recovery-authn-code-input/login-recovery-authn-code-input.component.js.map +0 -1
- package/login/pages/login-reset-otp/login-reset-otp.component.html +0 -65
- package/login/pages/login-reset-otp/login-reset-otp.component.js.map +0 -1
- package/login/pages/login-reset-password/login-reset-password.component.html +0 -95
- package/login/pages/login-reset-password/login-reset-password.component.js.map +0 -1
- package/login/pages/login-update-password/login-update-password.component.html +0 -116
- package/login/pages/login-update-password/login-update-password.component.js.map +0 -1
- package/login/pages/login-update-profile/login-update-profile.component.html +0 -59
- package/login/pages/login-update-profile/login-update-profile.component.js.map +0 -1
- package/login/pages/login-username/login-username.component.html +0 -161
- package/login/pages/login-username/login-username.component.js.map +0 -1
- package/login/pages/login-verify-email/login-verify-email.component.html +0 -27
- package/login/pages/login-verify-email/login-verify-email.component.js.map +0 -1
- package/login/pages/login-x509-info/login-x509-info.component.html +0 -102
- package/login/pages/login-x509-info/login-x509-info.component.js.map +0 -1
- package/login/pages/logout-confirm/logout-confirm.component.html +0 -59
- package/login/pages/logout-confirm/logout-confirm.component.js.map +0 -1
- package/login/pages/register/register.component.html +0 -126
- package/login/pages/register/register.component.js.map +0 -1
- package/login/pages/saml-post-form/saml-post-form.component.html +0 -51
- package/login/pages/saml-post-form/saml-post-form.component.js.map +0 -1
- package/login/pages/select-authenticator/select-authenticator.component.html +0 -49
- package/login/pages/select-authenticator/select-authenticator.component.js.map +0 -1
- package/login/pages/terms/terms.component.html +0 -36
- package/login/pages/terms/terms.component.js.map +0 -1
- package/login/pages/update-email/update-email.component.html +0 -58
- package/login/pages/update-email/update-email.component.js.map +0 -1
- package/login/pages/webauthn-authenticate/webauthn-authenticate.component.html +0 -162
- package/login/pages/webauthn-authenticate/webauthn-authenticate.component.js.map +0 -1
- package/login/pages/webauthn-error/webauthn-error.component.html +0 -60
- package/login/pages/webauthn-error/webauthn-error.component.js.map +0 -1
- package/login/pages/webauthn-register/webauthn-register.component.html +0 -82
- package/login/pages/webauthn-register/webauthn-register.component.js.map +0 -1
- package/login/pipes/advanced-msg-str.pipe.d.ts +0 -5
- package/login/pipes/advanced-msg-str.pipe.js +0 -31
- package/login/pipes/advanced-msg-str.pipe.js.map +0 -1
- package/login/pipes/index.d.ts +0 -6
- package/login/pipes/index.js +0 -7
- package/login/pipes/index.js.map +0 -1
- package/login/pipes/input-type.pipe.d.ts +0 -4
- package/login/pipes/input-type.pipe.js +0 -23
- package/login/pipes/input-type.pipe.js.map +0 -1
- package/login/pipes/kc-sanitize.pipe.d.ts +0 -7
- package/login/pipes/kc-sanitize.pipe.js +0 -36
- package/login/pipes/kc-sanitize.pipe.js.map +0 -1
- package/login/pipes/msg-str.pipe.d.ts +0 -6
- package/login/pipes/msg-str.pipe.js +0 -31
- package/login/pipes/msg-str.pipe.js.map +0 -1
- package/login/pipes/to-array.pipe.d.ts +0 -4
- package/login/pipes/to-array.pipe.js +0 -24
- package/login/pipes/to-array.pipe.js.map +0 -1
- package/login/pipes/to-number.pipe.d.ts +0 -4
- package/login/pipes/to-number.pipe.js +0 -23
- package/login/pipes/to-number.pipe.js.map +0 -1
- package/login/services/index.d.ts +0 -2
- package/login/services/index.js +0 -3
- package/login/services/index.js.map +0 -1
- package/login/services/login-resource-injector.service.js.map +0 -1
- package/login/services/user-profile-form.service.js.map +0 -1
- package/src/lib/i18n.ts +0 -9
- package/src/lib/models/index.ts +0 -1
- package/src/lib/providers/keycloakify-angular.providers.ts +0 -92
- package/src/lib/public-api.ts +0 -12
- package/src/lib/services/i18n.service.ts +0 -5
- package/src/lib/services/index.ts +0 -2
- package/src/login/components/index.ts +0 -11
- package/src/login/directives/index.ts +0 -2
- package/src/login/pipes/advanced-msg-str.pipe.ts +0 -13
- package/src/login/pipes/index.ts +0 -6
- package/src/login/pipes/kc-sanitize.pipe.ts +0 -36
- package/src/login/pipes/msg-str.pipe.ts +0 -14
- package/src/login/pipes/to-array.pipe.ts +0 -15
- package/src/login/pipes/to-number.pipe.ts +0 -13
- package/src/login/services/index.ts +0 -2
|
@@ -8,32 +8,30 @@ import {
|
|
|
8
8
|
signal,
|
|
9
9
|
Signal,
|
|
10
10
|
WritableSignal
|
|
11
|
-
} from
|
|
12
|
-
import { DomSanitizer, SafeHtml } from
|
|
11
|
+
} from '@angular/core';
|
|
12
|
+
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
13
|
+
import { LOGIN_I18N } from '@keycloakify/angular/login/tokens/i18n.token';
|
|
14
|
+
import { KC_LOGIN_CONTEXT } from '@keycloakify/angular/login/tokens/kc-context.token';
|
|
15
|
+
import { DO_MAKE_USER_CONFIRM_PASSWORD } from '@keycloakify/angular/login/tokens/make-user-confirm-password.token';
|
|
13
16
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} from
|
|
18
|
-
import {
|
|
19
|
-
Attribute,
|
|
20
|
-
KcContext,
|
|
21
|
-
PasswordPolicies,
|
|
22
|
-
Validators
|
|
23
|
-
} from "keycloakify/login/KcContext";
|
|
17
|
+
type Attribute,
|
|
18
|
+
type PasswordPolicies,
|
|
19
|
+
type Validators
|
|
20
|
+
} from 'keycloakify/login/KcContext';
|
|
24
21
|
import type {
|
|
25
22
|
KcContextLike as KcContextLike_i18n,
|
|
26
23
|
MessageKey_defaultSet
|
|
27
|
-
} from
|
|
28
|
-
import
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
24
|
+
} from 'keycloakify/login/i18n/noJsx';
|
|
25
|
+
import { emailRegexp } from 'keycloakify/tools/emailRegExp';
|
|
26
|
+
import { formatNumber } from 'keycloakify/tools/formatNumber';
|
|
27
|
+
import { structuredCloneButFunctions } from 'keycloakify/tools/structuredCloneButFunctions';
|
|
28
|
+
import { assert, id } from 'tsafe';
|
|
29
|
+
import { type KcContext } from '../KcContext';
|
|
30
|
+
import type { I18n } from '../i18n';
|
|
31
|
+
import { LoginResourceInjectorService } from './login-resource-injector.service';
|
|
34
32
|
|
|
35
33
|
type KcContextLike_useGetErrors = KcContextLike_i18n & {
|
|
36
|
-
messagesPerField: Pick<KcContext[
|
|
34
|
+
messagesPerField: Pick<KcContext['messagesPerField'], 'existsError' | 'get'>;
|
|
37
35
|
passwordPolicies?: PasswordPolicies;
|
|
38
36
|
};
|
|
39
37
|
export namespace FormFieldError {
|
|
@@ -45,20 +43,20 @@ export namespace FormFieldError {
|
|
|
45
43
|
|
|
46
44
|
export namespace Source {
|
|
47
45
|
export type Validator = {
|
|
48
|
-
type:
|
|
46
|
+
type: 'validator';
|
|
49
47
|
name: keyof Validators;
|
|
50
48
|
};
|
|
51
49
|
export type PasswordPolicy = {
|
|
52
|
-
type:
|
|
50
|
+
type: 'passwordPolicy';
|
|
53
51
|
name: keyof PasswordPolicies;
|
|
54
52
|
};
|
|
55
53
|
export type Server = {
|
|
56
|
-
type:
|
|
54
|
+
type: 'server';
|
|
57
55
|
};
|
|
58
56
|
|
|
59
57
|
export type Other = {
|
|
60
|
-
type:
|
|
61
|
-
rule:
|
|
58
|
+
type: 'other';
|
|
59
|
+
rule: 'passwordConfirmMatchesPassword' | 'requiredField';
|
|
62
60
|
};
|
|
63
61
|
}
|
|
64
62
|
}
|
|
@@ -104,23 +102,23 @@ type FormState = {
|
|
|
104
102
|
};
|
|
105
103
|
export type FormAction =
|
|
106
104
|
| {
|
|
107
|
-
action:
|
|
105
|
+
action: 'update';
|
|
108
106
|
name: string;
|
|
109
107
|
valueOrValues: string | string[];
|
|
110
108
|
/** Default false */
|
|
111
109
|
displayErrorsImmediately?: boolean;
|
|
112
110
|
}
|
|
113
111
|
| {
|
|
114
|
-
action:
|
|
112
|
+
action: 'focus lost';
|
|
115
113
|
name: string;
|
|
116
114
|
fieldIndex: number | undefined;
|
|
117
115
|
};
|
|
118
116
|
|
|
119
|
-
@Injectable({ providedIn:
|
|
117
|
+
@Injectable({ providedIn: 'root' })
|
|
120
118
|
export class UserProfileFormService {
|
|
121
119
|
private kcContext: KcContextLike =
|
|
122
|
-
inject<Extract<KcContext, { pageId:
|
|
123
|
-
private i18n = inject<I18n>(
|
|
120
|
+
inject<Extract<KcContext, { pageId: 'register.ftl' }>>(KC_LOGIN_CONTEXT);
|
|
121
|
+
private i18n = inject<I18n>(LOGIN_I18N);
|
|
124
122
|
private doMakeUserConfirmPassword = inject(DO_MAKE_USER_CONFIRM_PASSWORD);
|
|
125
123
|
private loginResourceInjectorService = inject(LoginResourceInjectorService);
|
|
126
124
|
private sanitizer: DomSanitizer = inject(DomSanitizer);
|
|
@@ -128,22 +126,22 @@ export class UserProfileFormService {
|
|
|
128
126
|
const attributes: Attribute[] = (() => {
|
|
129
127
|
mock_user_profile_attributes_for_older_keycloak_versions: {
|
|
130
128
|
if (
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
'profile' in this.kcContext &&
|
|
130
|
+
'attributesByName' in this.kcContext.profile &&
|
|
133
131
|
Object.keys(this.kcContext.profile.attributesByName).length !== 0
|
|
134
132
|
) {
|
|
135
133
|
break mock_user_profile_attributes_for_older_keycloak_versions;
|
|
136
134
|
}
|
|
137
135
|
|
|
138
136
|
if (
|
|
139
|
-
|
|
137
|
+
'register' in this.kcContext &&
|
|
140
138
|
this.kcContext.register instanceof Object &&
|
|
141
|
-
|
|
139
|
+
'formData' in this.kcContext.register
|
|
142
140
|
) {
|
|
143
141
|
//NOTE: Handle legacy register.ftl page
|
|
144
|
-
return ([
|
|
142
|
+
return (['firstName', 'lastName', 'email', 'username'] as const)
|
|
145
143
|
.filter(name =>
|
|
146
|
-
name !==
|
|
144
|
+
name !== 'username'
|
|
147
145
|
? true
|
|
148
146
|
: !this.kcContext.realm.registrationEmailAsUsername
|
|
149
147
|
)
|
|
@@ -155,17 +153,17 @@ export class UserProfileFormService {
|
|
|
155
153
|
),
|
|
156
154
|
required: true,
|
|
157
155
|
value:
|
|
158
|
-
(this.kcContext as any).register.formData[name] ??
|
|
156
|
+
(this.kcContext as any).register.formData[name] ?? '',
|
|
159
157
|
html5DataAnnotations: {},
|
|
160
158
|
readOnly: false,
|
|
161
159
|
validators: {},
|
|
162
160
|
annotations: {},
|
|
163
161
|
autocomplete: (() => {
|
|
164
162
|
switch (name) {
|
|
165
|
-
case
|
|
166
|
-
return
|
|
167
|
-
case
|
|
168
|
-
return
|
|
163
|
+
case 'email':
|
|
164
|
+
return 'email';
|
|
165
|
+
case 'username':
|
|
166
|
+
return 'username';
|
|
169
167
|
default:
|
|
170
168
|
return undefined;
|
|
171
169
|
}
|
|
@@ -174,11 +172,11 @@ export class UserProfileFormService {
|
|
|
174
172
|
);
|
|
175
173
|
}
|
|
176
174
|
|
|
177
|
-
if (
|
|
175
|
+
if ('user' in this.kcContext && this.kcContext.user instanceof Object) {
|
|
178
176
|
//NOTE: Handle legacy login-update-profile.ftl
|
|
179
|
-
return ([
|
|
177
|
+
return (['username', 'email', 'firstName', 'lastName'] as const)
|
|
180
178
|
.filter(name =>
|
|
181
|
-
name !==
|
|
179
|
+
name !== 'username'
|
|
182
180
|
? true
|
|
183
181
|
: (this.kcContext as any).user.editUsernameAllowed
|
|
184
182
|
)
|
|
@@ -189,17 +187,17 @@ export class UserProfileFormService {
|
|
|
189
187
|
`\${${name}}`
|
|
190
188
|
),
|
|
191
189
|
required: true,
|
|
192
|
-
value: (this.kcContext as any).user[name] ??
|
|
190
|
+
value: (this.kcContext as any).user[name] ?? '',
|
|
193
191
|
html5DataAnnotations: {},
|
|
194
192
|
readOnly: false,
|
|
195
193
|
validators: {},
|
|
196
194
|
annotations: {},
|
|
197
195
|
autocomplete: (() => {
|
|
198
196
|
switch (name) {
|
|
199
|
-
case
|
|
200
|
-
return
|
|
201
|
-
case
|
|
202
|
-
return
|
|
197
|
+
case 'email':
|
|
198
|
+
return 'email';
|
|
199
|
+
case 'username':
|
|
200
|
+
return 'username';
|
|
203
201
|
default:
|
|
204
202
|
return undefined;
|
|
205
203
|
}
|
|
@@ -208,24 +206,24 @@ export class UserProfileFormService {
|
|
|
208
206
|
);
|
|
209
207
|
}
|
|
210
208
|
|
|
211
|
-
if (
|
|
209
|
+
if ('email' in this.kcContext && this.kcContext.email instanceof Object) {
|
|
212
210
|
//NOTE: Handle legacy update-email.ftl
|
|
213
211
|
return [
|
|
214
212
|
id<Attribute>({
|
|
215
|
-
name:
|
|
213
|
+
name: 'email',
|
|
216
214
|
displayName: id<`\${${MessageKey_defaultSet}}`>(`\${email}`),
|
|
217
215
|
required: true,
|
|
218
|
-
value: (this.kcContext.email as any).value ??
|
|
216
|
+
value: (this.kcContext.email as any).value ?? '',
|
|
219
217
|
html5DataAnnotations: {},
|
|
220
218
|
readOnly: false,
|
|
221
219
|
validators: {},
|
|
222
220
|
annotations: {},
|
|
223
|
-
autocomplete:
|
|
221
|
+
autocomplete: 'email'
|
|
224
222
|
})
|
|
225
223
|
];
|
|
226
224
|
}
|
|
227
225
|
|
|
228
|
-
assert(false,
|
|
226
|
+
assert(false, 'Unable to mock user profile from the current kcContext');
|
|
229
227
|
}
|
|
230
228
|
|
|
231
229
|
return Object.values(this.kcContext.profile.attributesByName).map(
|
|
@@ -235,7 +233,7 @@ export class UserProfileFormService {
|
|
|
235
233
|
// Retro-compatibility and consistency patches
|
|
236
234
|
attributes.forEach(attribute => {
|
|
237
235
|
patch_legacy_group: {
|
|
238
|
-
if (typeof attribute.group !==
|
|
236
|
+
if (typeof attribute.group !== 'string') {
|
|
239
237
|
break patch_legacy_group;
|
|
240
238
|
}
|
|
241
239
|
|
|
@@ -259,7 +257,7 @@ export class UserProfileFormService {
|
|
|
259
257
|
// @ts-expect-error
|
|
260
258
|
delete attribute.groupAnnotations;
|
|
261
259
|
|
|
262
|
-
if (group ===
|
|
260
|
+
if (group === '') {
|
|
263
261
|
break patch_legacy_group;
|
|
264
262
|
}
|
|
265
263
|
|
|
@@ -277,7 +275,7 @@ export class UserProfileFormService {
|
|
|
277
275
|
attribute.validators.options !== undefined &&
|
|
278
276
|
attribute.annotations.inputType === undefined
|
|
279
277
|
) {
|
|
280
|
-
attribute.annotations.inputType =
|
|
278
|
+
attribute.annotations.inputType = 'select';
|
|
281
279
|
}
|
|
282
280
|
|
|
283
281
|
// Consistency patch on values/value property
|
|
@@ -305,8 +303,8 @@ export class UserProfileFormService {
|
|
|
305
303
|
if (
|
|
306
304
|
attribute.name !==
|
|
307
305
|
(this.kcContext.realm.registrationEmailAsUsername
|
|
308
|
-
?
|
|
309
|
-
:
|
|
306
|
+
? 'email'
|
|
307
|
+
: 'username')
|
|
310
308
|
) {
|
|
311
309
|
// NOTE: We want to add password and password-confirm after the field that identifies the user.
|
|
312
310
|
// It's either email or username.
|
|
@@ -317,25 +315,25 @@ export class UserProfileFormService {
|
|
|
317
315
|
i + 1,
|
|
318
316
|
0,
|
|
319
317
|
{
|
|
320
|
-
name:
|
|
321
|
-
displayName: id<`\${${MessageKey_defaultSet}}`>(
|
|
318
|
+
name: 'password',
|
|
319
|
+
displayName: id<`\${${MessageKey_defaultSet}}`>('${password}'),
|
|
322
320
|
required: true,
|
|
323
321
|
readOnly: false,
|
|
324
322
|
validators: {},
|
|
325
323
|
annotations: {},
|
|
326
|
-
autocomplete:
|
|
324
|
+
autocomplete: 'new-password',
|
|
327
325
|
html5DataAnnotations: {}
|
|
328
326
|
},
|
|
329
327
|
{
|
|
330
|
-
name:
|
|
328
|
+
name: 'password-confirm',
|
|
331
329
|
displayName:
|
|
332
|
-
id<`\${${MessageKey_defaultSet}}`>(
|
|
330
|
+
id<`\${${MessageKey_defaultSet}}`>('${passwordConfirm}'),
|
|
333
331
|
required: true,
|
|
334
332
|
readOnly: false,
|
|
335
333
|
validators: {},
|
|
336
334
|
annotations: {},
|
|
337
335
|
html5DataAnnotations: {},
|
|
338
|
-
autocomplete:
|
|
336
|
+
autocomplete: 'new-password'
|
|
339
337
|
}
|
|
340
338
|
);
|
|
341
339
|
});
|
|
@@ -351,7 +349,7 @@ export class UserProfileFormService {
|
|
|
351
349
|
break handle_multi_valued_attribute;
|
|
352
350
|
}
|
|
353
351
|
|
|
354
|
-
const values = attribute.values?.length ? attribute.values : [
|
|
352
|
+
const values = attribute.values?.length ? attribute.values : [''];
|
|
355
353
|
|
|
356
354
|
apply_validator_min_range: {
|
|
357
355
|
if (this.getIsMultivaluedSingleField({ attribute })) {
|
|
@@ -373,7 +371,7 @@ export class UserProfileFormService {
|
|
|
373
371
|
const min = parseInt(`${minStr}`);
|
|
374
372
|
|
|
375
373
|
for (let index = values.length; index < min; index++) {
|
|
376
|
-
values.push(
|
|
374
|
+
values.push('');
|
|
377
375
|
}
|
|
378
376
|
}
|
|
379
377
|
|
|
@@ -387,7 +385,7 @@ export class UserProfileFormService {
|
|
|
387
385
|
|
|
388
386
|
initialFormFieldState.push({
|
|
389
387
|
attribute,
|
|
390
|
-
valueOrValues: attribute.value ??
|
|
388
|
+
valueOrValues: attribute.value ?? ''
|
|
391
389
|
});
|
|
392
390
|
}
|
|
393
391
|
|
|
@@ -425,7 +423,7 @@ export class UserProfileFormService {
|
|
|
425
423
|
}) => ({
|
|
426
424
|
displayableErrors: errors.filter(error => {
|
|
427
425
|
const hasLostFocusAtLeastOnce =
|
|
428
|
-
typeof hasLostFocusAtLeastOnceOrArr ===
|
|
426
|
+
typeof hasLostFocusAtLeastOnceOrArr === 'boolean'
|
|
429
427
|
? hasLostFocusAtLeastOnceOrArr
|
|
430
428
|
: error.fieldIndex !== undefined
|
|
431
429
|
? hasLostFocusAtLeastOnceOrArr[error.fieldIndex]
|
|
@@ -434,64 +432,64 @@ export class UserProfileFormService {
|
|
|
434
432
|
];
|
|
435
433
|
let value = false;
|
|
436
434
|
switch (error.source.type) {
|
|
437
|
-
case
|
|
435
|
+
case 'server':
|
|
438
436
|
value = true;
|
|
439
437
|
break;
|
|
440
|
-
case
|
|
438
|
+
case 'other':
|
|
441
439
|
switch (error.source.rule) {
|
|
442
|
-
case
|
|
440
|
+
case 'requiredField':
|
|
443
441
|
value = hasLostFocusAtLeastOnce;
|
|
444
442
|
break;
|
|
445
|
-
case
|
|
443
|
+
case 'passwordConfirmMatchesPassword':
|
|
446
444
|
value = hasLostFocusAtLeastOnce;
|
|
447
445
|
break;
|
|
448
446
|
}
|
|
449
447
|
// assert<Equals<typeof error.source.rule, never>>(false);
|
|
450
448
|
break;
|
|
451
|
-
case
|
|
449
|
+
case 'passwordPolicy':
|
|
452
450
|
switch (error.source.name) {
|
|
453
|
-
case
|
|
451
|
+
case 'length':
|
|
454
452
|
value = hasLostFocusAtLeastOnce;
|
|
455
453
|
break;
|
|
456
|
-
case
|
|
454
|
+
case 'digits':
|
|
457
455
|
value = hasLostFocusAtLeastOnce;
|
|
458
456
|
break;
|
|
459
|
-
case
|
|
457
|
+
case 'lowerCase':
|
|
460
458
|
value = hasLostFocusAtLeastOnce;
|
|
461
459
|
break;
|
|
462
|
-
case
|
|
460
|
+
case 'upperCase':
|
|
463
461
|
value = hasLostFocusAtLeastOnce;
|
|
464
462
|
break;
|
|
465
|
-
case
|
|
463
|
+
case 'specialChars':
|
|
466
464
|
value = hasLostFocusAtLeastOnce;
|
|
467
465
|
break;
|
|
468
|
-
case
|
|
466
|
+
case 'notUsername':
|
|
469
467
|
value = true;
|
|
470
468
|
break;
|
|
471
|
-
case
|
|
469
|
+
case 'notEmail':
|
|
472
470
|
value = true;
|
|
473
471
|
break;
|
|
474
472
|
}
|
|
475
473
|
// assert<Equals<typeof error.source, never>>(false);
|
|
476
474
|
break;
|
|
477
|
-
case
|
|
475
|
+
case 'validator':
|
|
478
476
|
switch (error.source.name) {
|
|
479
|
-
case
|
|
477
|
+
case 'length':
|
|
480
478
|
value = hasLostFocusAtLeastOnce;
|
|
481
479
|
break;
|
|
482
|
-
case
|
|
480
|
+
case 'pattern':
|
|
483
481
|
value = hasLostFocusAtLeastOnce;
|
|
484
482
|
break;
|
|
485
|
-
case
|
|
483
|
+
case 'email':
|
|
486
484
|
value = hasLostFocusAtLeastOnce;
|
|
487
485
|
break;
|
|
488
|
-
case
|
|
486
|
+
case 'integer':
|
|
489
487
|
value = hasLostFocusAtLeastOnce;
|
|
490
488
|
break;
|
|
491
|
-
case
|
|
489
|
+
case 'multivalued':
|
|
492
490
|
value = hasLostFocusAtLeastOnce;
|
|
493
491
|
break;
|
|
494
|
-
case
|
|
492
|
+
case 'options':
|
|
495
493
|
value = hasLostFocusAtLeastOnce;
|
|
496
494
|
break;
|
|
497
495
|
}
|
|
@@ -513,9 +511,9 @@ export class UserProfileFormService {
|
|
|
513
511
|
constructor() {
|
|
514
512
|
this.loginResourceInjectorService.insertAdditionalScripts(
|
|
515
513
|
Object.keys(this.kcContext.profile?.html5DataAnnotations ?? {})
|
|
516
|
-
.filter(key => key !==
|
|
514
|
+
.filter(key => key !== 'kcMultivalued' && key !== 'kcNumberFormat') // NOTE: Keycloakify handles it.
|
|
517
515
|
.map(key => ({
|
|
518
|
-
type:
|
|
516
|
+
type: 'module',
|
|
519
517
|
src: `${this.kcContext.url.resourcesPath}/js/${key}.js`,
|
|
520
518
|
id: `${this.kcContext.url.resourcesPath}/js/${key}.js`
|
|
521
519
|
}))
|
|
@@ -530,7 +528,7 @@ export class UserProfileFormService {
|
|
|
530
528
|
);
|
|
531
529
|
assert(formFieldState !== undefined);
|
|
532
530
|
switch (formAction.action) {
|
|
533
|
-
case
|
|
531
|
+
case 'update':
|
|
534
532
|
formFieldState.valueOrValues = formAction.valueOrValues;
|
|
535
533
|
|
|
536
534
|
apply_formatters: {
|
|
@@ -570,7 +568,7 @@ export class UserProfileFormService {
|
|
|
570
568
|
? formAction.valueOrValues.map((...[, index]) => index)
|
|
571
569
|
: [undefined]) {
|
|
572
570
|
this.dispatchFormAction({
|
|
573
|
-
action:
|
|
571
|
+
action: 'focus lost',
|
|
574
572
|
name: formAction.name,
|
|
575
573
|
fieldIndex
|
|
576
574
|
});
|
|
@@ -582,13 +580,13 @@ export class UserProfileFormService {
|
|
|
582
580
|
break update_password_confirm;
|
|
583
581
|
}
|
|
584
582
|
|
|
585
|
-
if (formAction.name !==
|
|
583
|
+
if (formAction.name !== 'password') {
|
|
586
584
|
break update_password_confirm;
|
|
587
585
|
}
|
|
588
586
|
|
|
589
587
|
this.dispatchFormAction({
|
|
590
|
-
action:
|
|
591
|
-
name:
|
|
588
|
+
action: 'update',
|
|
589
|
+
name: 'password-confirm',
|
|
592
590
|
valueOrValues: formAction.valueOrValues,
|
|
593
591
|
displayErrorsImmediately: formAction.displayErrorsImmediately
|
|
594
592
|
});
|
|
@@ -599,16 +597,16 @@ export class UserProfileFormService {
|
|
|
599
597
|
break trigger_password_confirm_validation_on_password_change;
|
|
600
598
|
}
|
|
601
599
|
|
|
602
|
-
if (formAction.name !==
|
|
600
|
+
if (formAction.name !== 'password') {
|
|
603
601
|
break trigger_password_confirm_validation_on_password_change;
|
|
604
602
|
}
|
|
605
603
|
|
|
606
604
|
this.dispatchFormAction({
|
|
607
|
-
action:
|
|
608
|
-
name:
|
|
605
|
+
action: 'update',
|
|
606
|
+
name: 'password-confirm',
|
|
609
607
|
valueOrValues: (() => {
|
|
610
608
|
const formFieldState = state.formFieldStates.find(
|
|
611
|
-
({ attribute }) => attribute.name ===
|
|
609
|
+
({ attribute }) => attribute.name === 'password-confirm'
|
|
612
610
|
);
|
|
613
611
|
|
|
614
612
|
assert(formFieldState !== undefined);
|
|
@@ -620,7 +618,7 @@ export class UserProfileFormService {
|
|
|
620
618
|
}
|
|
621
619
|
|
|
622
620
|
break;
|
|
623
|
-
case
|
|
621
|
+
case 'focus lost':
|
|
624
622
|
if (formFieldState.hasLostFocusAtLeastOnce instanceof Array) {
|
|
625
623
|
const { fieldIndex } = formAction;
|
|
626
624
|
assert(fieldIndex !== undefined);
|
|
@@ -643,7 +641,7 @@ export class UserProfileFormService {
|
|
|
643
641
|
private getIsMultivaluedSingleField(params: { attribute: Attribute }) {
|
|
644
642
|
const { attribute } = params;
|
|
645
643
|
|
|
646
|
-
return attribute.annotations.inputType?.startsWith(
|
|
644
|
+
return attribute.annotations.inputType?.startsWith('multiselect') ?? false;
|
|
647
645
|
}
|
|
648
646
|
|
|
649
647
|
private getErrors(params: {
|
|
@@ -692,7 +690,7 @@ export class UserProfileFormService {
|
|
|
692
690
|
|
|
693
691
|
server_side_error: {
|
|
694
692
|
if (attribute.multivalued) {
|
|
695
|
-
const defaultValues = attribute.values?.length ? attribute.values : [
|
|
693
|
+
const defaultValues = attribute.values?.length ? attribute.values : [''];
|
|
696
694
|
|
|
697
695
|
assert(valueOrValues instanceof Array);
|
|
698
696
|
|
|
@@ -705,9 +703,9 @@ export class UserProfileFormService {
|
|
|
705
703
|
break server_side_error;
|
|
706
704
|
}
|
|
707
705
|
} else {
|
|
708
|
-
const defaultValue = attribute.value ??
|
|
706
|
+
const defaultValue = attribute.value ?? '';
|
|
709
707
|
|
|
710
|
-
assert(typeof valueOrValues ===
|
|
708
|
+
assert(typeof valueOrValues === 'string');
|
|
711
709
|
|
|
712
710
|
const value = valueOrValues;
|
|
713
711
|
|
|
@@ -738,7 +736,7 @@ export class UserProfileFormService {
|
|
|
738
736
|
),
|
|
739
737
|
fieldIndex: undefined,
|
|
740
738
|
source: {
|
|
741
|
-
type:
|
|
739
|
+
type: 'server'
|
|
742
740
|
}
|
|
743
741
|
}
|
|
744
742
|
];
|
|
@@ -784,8 +782,8 @@ export class UserProfileFormService {
|
|
|
784
782
|
return specificValueErrors
|
|
785
783
|
.filter(error => {
|
|
786
784
|
if (
|
|
787
|
-
error.source.type ===
|
|
788
|
-
error.source.rule ===
|
|
785
|
+
error.source.type === 'other' &&
|
|
786
|
+
error.source.rule === 'requiredField'
|
|
789
787
|
) {
|
|
790
788
|
return false;
|
|
791
789
|
}
|
|
@@ -806,11 +804,11 @@ export class UserProfileFormService {
|
|
|
806
804
|
break required_field;
|
|
807
805
|
}
|
|
808
806
|
|
|
809
|
-
if (values.every(value => value !==
|
|
807
|
+
if (values.every(value => value !== '')) {
|
|
810
808
|
break required_field;
|
|
811
809
|
}
|
|
812
810
|
|
|
813
|
-
const msgArgs = [
|
|
811
|
+
const msgArgs = ['error-user-attribute-required'] as const;
|
|
814
812
|
|
|
815
813
|
errors.push({
|
|
816
814
|
errorMessage: this.sanitizer.bypassSecurityTrustHtml(
|
|
@@ -819,8 +817,8 @@ export class UserProfileFormService {
|
|
|
819
817
|
errorMessageStr: msgStr(...msgArgs),
|
|
820
818
|
fieldIndex: undefined,
|
|
821
819
|
source: {
|
|
822
|
-
type:
|
|
823
|
-
rule:
|
|
820
|
+
type: 'other',
|
|
821
|
+
rule: 'requiredField'
|
|
824
822
|
}
|
|
825
823
|
});
|
|
826
824
|
}
|
|
@@ -837,7 +835,7 @@ export class UserProfileFormService {
|
|
|
837
835
|
break handle_multi_valued_single_field;
|
|
838
836
|
}
|
|
839
837
|
|
|
840
|
-
const validatorName =
|
|
838
|
+
const validatorName = 'multivalued';
|
|
841
839
|
|
|
842
840
|
const validator = attribute.validators[validatorName];
|
|
843
841
|
|
|
@@ -866,7 +864,7 @@ export class UserProfileFormService {
|
|
|
866
864
|
}
|
|
867
865
|
|
|
868
866
|
const msgArgs = [
|
|
869
|
-
|
|
867
|
+
'error-invalid-multivalued-size',
|
|
870
868
|
`${min}`,
|
|
871
869
|
`${max}`
|
|
872
870
|
] as const;
|
|
@@ -879,21 +877,21 @@ export class UserProfileFormService {
|
|
|
879
877
|
errorMessageStr: msgStr(...msgArgs),
|
|
880
878
|
fieldIndex: undefined,
|
|
881
879
|
source: {
|
|
882
|
-
type:
|
|
880
|
+
type: 'validator',
|
|
883
881
|
name: validatorName
|
|
884
882
|
}
|
|
885
883
|
}
|
|
886
884
|
];
|
|
887
885
|
}
|
|
888
886
|
|
|
889
|
-
assert(typeof valueOrValues ===
|
|
887
|
+
assert(typeof valueOrValues === 'string');
|
|
890
888
|
|
|
891
889
|
const value = valueOrValues;
|
|
892
890
|
|
|
893
891
|
const errors: FormFieldError[] = [];
|
|
894
892
|
|
|
895
893
|
check_password_policies: {
|
|
896
|
-
if (attributeName !==
|
|
894
|
+
if (attributeName !== 'password') {
|
|
897
895
|
break check_password_policies;
|
|
898
896
|
}
|
|
899
897
|
|
|
@@ -902,7 +900,7 @@ export class UserProfileFormService {
|
|
|
902
900
|
}
|
|
903
901
|
|
|
904
902
|
check_password_policy_x: {
|
|
905
|
-
const policyName =
|
|
903
|
+
const policyName = 'length';
|
|
906
904
|
|
|
907
905
|
const policy = passwordPolicies[policyName];
|
|
908
906
|
|
|
@@ -917,7 +915,7 @@ export class UserProfileFormService {
|
|
|
917
915
|
}
|
|
918
916
|
|
|
919
917
|
const msgArgs = [
|
|
920
|
-
|
|
918
|
+
'invalidPasswordMinLengthMessage',
|
|
921
919
|
`${minLength}`
|
|
922
920
|
] as const;
|
|
923
921
|
|
|
@@ -928,14 +926,14 @@ export class UserProfileFormService {
|
|
|
928
926
|
errorMessageStr: msgStr(...msgArgs),
|
|
929
927
|
fieldIndex: undefined,
|
|
930
928
|
source: {
|
|
931
|
-
type:
|
|
929
|
+
type: 'passwordPolicy',
|
|
932
930
|
name: policyName
|
|
933
931
|
}
|
|
934
932
|
});
|
|
935
933
|
}
|
|
936
934
|
|
|
937
935
|
check_password_policy_x: {
|
|
938
|
-
const policyName =
|
|
936
|
+
const policyName = 'digits';
|
|
939
937
|
|
|
940
938
|
const policy = passwordPolicies[policyName];
|
|
941
939
|
|
|
@@ -946,14 +944,14 @@ export class UserProfileFormService {
|
|
|
946
944
|
const minNumberOfDigits = policy;
|
|
947
945
|
|
|
948
946
|
if (
|
|
949
|
-
value.split(
|
|
947
|
+
value.split('').filter(char => !isNaN(parseInt(char))).length >=
|
|
950
948
|
minNumberOfDigits
|
|
951
949
|
) {
|
|
952
950
|
break check_password_policy_x;
|
|
953
951
|
}
|
|
954
952
|
|
|
955
953
|
const msgArgs = [
|
|
956
|
-
|
|
954
|
+
'invalidPasswordMinDigitsMessage',
|
|
957
955
|
`${minNumberOfDigits}`
|
|
958
956
|
] as const;
|
|
959
957
|
|
|
@@ -964,14 +962,14 @@ export class UserProfileFormService {
|
|
|
964
962
|
errorMessageStr: msgStr(...msgArgs),
|
|
965
963
|
fieldIndex: undefined,
|
|
966
964
|
source: {
|
|
967
|
-
type:
|
|
965
|
+
type: 'passwordPolicy',
|
|
968
966
|
name: policyName
|
|
969
967
|
}
|
|
970
968
|
});
|
|
971
969
|
}
|
|
972
970
|
|
|
973
971
|
check_password_policy_x: {
|
|
974
|
-
const policyName =
|
|
972
|
+
const policyName = 'lowerCase';
|
|
975
973
|
|
|
976
974
|
const policy = passwordPolicies[policyName];
|
|
977
975
|
|
|
@@ -983,7 +981,7 @@ export class UserProfileFormService {
|
|
|
983
981
|
|
|
984
982
|
if (
|
|
985
983
|
value
|
|
986
|
-
.split(
|
|
984
|
+
.split('')
|
|
987
985
|
.filter(
|
|
988
986
|
char =>
|
|
989
987
|
char === char.toLowerCase() && char !== char.toUpperCase()
|
|
@@ -993,7 +991,7 @@ export class UserProfileFormService {
|
|
|
993
991
|
}
|
|
994
992
|
|
|
995
993
|
const msgArgs = [
|
|
996
|
-
|
|
994
|
+
'invalidPasswordMinLowerCaseCharsMessage',
|
|
997
995
|
`${minNumberOfLowerCaseChar}`
|
|
998
996
|
] as const;
|
|
999
997
|
|
|
@@ -1004,14 +1002,14 @@ export class UserProfileFormService {
|
|
|
1004
1002
|
errorMessageStr: msgStr(...msgArgs),
|
|
1005
1003
|
fieldIndex: undefined,
|
|
1006
1004
|
source: {
|
|
1007
|
-
type:
|
|
1005
|
+
type: 'passwordPolicy',
|
|
1008
1006
|
name: policyName
|
|
1009
1007
|
}
|
|
1010
1008
|
});
|
|
1011
1009
|
}
|
|
1012
1010
|
|
|
1013
1011
|
check_password_policy_x: {
|
|
1014
|
-
const policyName =
|
|
1012
|
+
const policyName = 'upperCase';
|
|
1015
1013
|
|
|
1016
1014
|
const policy = passwordPolicies[policyName];
|
|
1017
1015
|
|
|
@@ -1023,7 +1021,7 @@ export class UserProfileFormService {
|
|
|
1023
1021
|
|
|
1024
1022
|
if (
|
|
1025
1023
|
value
|
|
1026
|
-
.split(
|
|
1024
|
+
.split('')
|
|
1027
1025
|
.filter(
|
|
1028
1026
|
char =>
|
|
1029
1027
|
char === char.toUpperCase() && char !== char.toLowerCase()
|
|
@@ -1033,7 +1031,7 @@ export class UserProfileFormService {
|
|
|
1033
1031
|
}
|
|
1034
1032
|
|
|
1035
1033
|
const msgArgs = [
|
|
1036
|
-
|
|
1034
|
+
'invalidPasswordMinUpperCaseCharsMessage',
|
|
1037
1035
|
`${minNumberOfUpperCaseChar}`
|
|
1038
1036
|
] as const;
|
|
1039
1037
|
|
|
@@ -1044,14 +1042,14 @@ export class UserProfileFormService {
|
|
|
1044
1042
|
errorMessageStr: msgStr(...msgArgs),
|
|
1045
1043
|
fieldIndex: undefined,
|
|
1046
1044
|
source: {
|
|
1047
|
-
type:
|
|
1045
|
+
type: 'passwordPolicy',
|
|
1048
1046
|
name: policyName
|
|
1049
1047
|
}
|
|
1050
1048
|
});
|
|
1051
1049
|
}
|
|
1052
1050
|
|
|
1053
1051
|
check_password_policy_x: {
|
|
1054
|
-
const policyName =
|
|
1052
|
+
const policyName = 'specialChars';
|
|
1055
1053
|
|
|
1056
1054
|
const policy = passwordPolicies[policyName];
|
|
1057
1055
|
|
|
@@ -1062,14 +1060,14 @@ export class UserProfileFormService {
|
|
|
1062
1060
|
const minNumberOfSpecialChar = policy;
|
|
1063
1061
|
|
|
1064
1062
|
if (
|
|
1065
|
-
value.split(
|
|
1063
|
+
value.split('').filter(char => !char.match(/[a-zA-Z0-9]/)).length >=
|
|
1066
1064
|
minNumberOfSpecialChar
|
|
1067
1065
|
) {
|
|
1068
1066
|
break check_password_policy_x;
|
|
1069
1067
|
}
|
|
1070
1068
|
|
|
1071
1069
|
const msgArgs = [
|
|
1072
|
-
|
|
1070
|
+
'invalidPasswordMinSpecialCharsMessage',
|
|
1073
1071
|
`${minNumberOfSpecialChar}`
|
|
1074
1072
|
] as const;
|
|
1075
1073
|
|
|
@@ -1080,14 +1078,14 @@ export class UserProfileFormService {
|
|
|
1080
1078
|
errorMessageStr: msgStr(...msgArgs),
|
|
1081
1079
|
fieldIndex: undefined,
|
|
1082
1080
|
source: {
|
|
1083
|
-
type:
|
|
1081
|
+
type: 'passwordPolicy',
|
|
1084
1082
|
name: policyName
|
|
1085
1083
|
}
|
|
1086
1084
|
});
|
|
1087
1085
|
}
|
|
1088
1086
|
|
|
1089
1087
|
check_password_policy_x: {
|
|
1090
|
-
const policyName =
|
|
1088
|
+
const policyName = 'notUsername';
|
|
1091
1089
|
|
|
1092
1090
|
const notUsername = passwordPolicies[policyName];
|
|
1093
1091
|
|
|
@@ -1096,7 +1094,7 @@ export class UserProfileFormService {
|
|
|
1096
1094
|
}
|
|
1097
1095
|
|
|
1098
1096
|
const usernameFormFieldState = formFieldStates.find(
|
|
1099
|
-
formFieldState => formFieldState.attribute.name ===
|
|
1097
|
+
formFieldState => formFieldState.attribute.name === 'username'
|
|
1100
1098
|
);
|
|
1101
1099
|
|
|
1102
1100
|
if (!usernameFormFieldState) {
|
|
@@ -1106,7 +1104,7 @@ export class UserProfileFormService {
|
|
|
1106
1104
|
const usernameValue = (() => {
|
|
1107
1105
|
let { valueOrValues } = usernameFormFieldState;
|
|
1108
1106
|
|
|
1109
|
-
assert(typeof valueOrValues ===
|
|
1107
|
+
assert(typeof valueOrValues === 'string');
|
|
1110
1108
|
|
|
1111
1109
|
unFormat_number: {
|
|
1112
1110
|
const { kcNumberUnFormat } = attribute.html5DataAnnotations ?? {};
|
|
@@ -1121,7 +1119,7 @@ export class UserProfileFormService {
|
|
|
1121
1119
|
return valueOrValues;
|
|
1122
1120
|
})();
|
|
1123
1121
|
|
|
1124
|
-
if (usernameValue ===
|
|
1122
|
+
if (usernameValue === '') {
|
|
1125
1123
|
break check_password_policy_x;
|
|
1126
1124
|
}
|
|
1127
1125
|
|
|
@@ -1129,7 +1127,7 @@ export class UserProfileFormService {
|
|
|
1129
1127
|
break check_password_policy_x;
|
|
1130
1128
|
}
|
|
1131
1129
|
|
|
1132
|
-
const msgArgs = [
|
|
1130
|
+
const msgArgs = ['invalidPasswordNotUsernameMessage'] as const;
|
|
1133
1131
|
|
|
1134
1132
|
errors.push({
|
|
1135
1133
|
errorMessage: this.sanitizer.bypassSecurityTrustHtml(
|
|
@@ -1138,14 +1136,14 @@ export class UserProfileFormService {
|
|
|
1138
1136
|
errorMessageStr: msgStr(...msgArgs),
|
|
1139
1137
|
fieldIndex: undefined,
|
|
1140
1138
|
source: {
|
|
1141
|
-
type:
|
|
1139
|
+
type: 'passwordPolicy',
|
|
1142
1140
|
name: policyName
|
|
1143
1141
|
}
|
|
1144
1142
|
});
|
|
1145
1143
|
}
|
|
1146
1144
|
|
|
1147
1145
|
check_password_policy_x: {
|
|
1148
|
-
const policyName =
|
|
1146
|
+
const policyName = 'notEmail';
|
|
1149
1147
|
|
|
1150
1148
|
const notEmail = passwordPolicies[policyName];
|
|
1151
1149
|
|
|
@@ -1154,19 +1152,19 @@ export class UserProfileFormService {
|
|
|
1154
1152
|
}
|
|
1155
1153
|
|
|
1156
1154
|
const emailFormFieldState = formFieldStates.find(
|
|
1157
|
-
formFieldState => formFieldState.attribute.name ===
|
|
1155
|
+
formFieldState => formFieldState.attribute.name === 'email'
|
|
1158
1156
|
);
|
|
1159
1157
|
|
|
1160
1158
|
if (!emailFormFieldState) {
|
|
1161
1159
|
break check_password_policy_x;
|
|
1162
1160
|
}
|
|
1163
1161
|
|
|
1164
|
-
assert(typeof emailFormFieldState.valueOrValues ===
|
|
1162
|
+
assert(typeof emailFormFieldState.valueOrValues === 'string');
|
|
1165
1163
|
|
|
1166
1164
|
{
|
|
1167
1165
|
const emailValue = emailFormFieldState.valueOrValues;
|
|
1168
1166
|
|
|
1169
|
-
if (emailValue ===
|
|
1167
|
+
if (emailValue === '') {
|
|
1170
1168
|
break check_password_policy_x;
|
|
1171
1169
|
}
|
|
1172
1170
|
|
|
@@ -1175,7 +1173,7 @@ export class UserProfileFormService {
|
|
|
1175
1173
|
}
|
|
1176
1174
|
}
|
|
1177
1175
|
|
|
1178
|
-
const msgArgs = [
|
|
1176
|
+
const msgArgs = ['invalidPasswordNotEmailMessage'] as const;
|
|
1179
1177
|
|
|
1180
1178
|
errors.push({
|
|
1181
1179
|
errorMessage: this.sanitizer.bypassSecurityTrustHtml(
|
|
@@ -1184,7 +1182,7 @@ export class UserProfileFormService {
|
|
|
1184
1182
|
errorMessageStr: msgStr(...msgArgs),
|
|
1185
1183
|
fieldIndex: undefined,
|
|
1186
1184
|
source: {
|
|
1187
|
-
type:
|
|
1185
|
+
type: 'passwordPolicy',
|
|
1188
1186
|
name: policyName
|
|
1189
1187
|
}
|
|
1190
1188
|
});
|
|
@@ -1192,17 +1190,17 @@ export class UserProfileFormService {
|
|
|
1192
1190
|
}
|
|
1193
1191
|
|
|
1194
1192
|
password_confirm_matches_password: {
|
|
1195
|
-
if (attributeName !==
|
|
1193
|
+
if (attributeName !== 'password-confirm') {
|
|
1196
1194
|
break password_confirm_matches_password;
|
|
1197
1195
|
}
|
|
1198
1196
|
|
|
1199
1197
|
const passwordFormFieldState = formFieldStates.find(
|
|
1200
|
-
formFieldState => formFieldState.attribute.name ===
|
|
1198
|
+
formFieldState => formFieldState.attribute.name === 'password'
|
|
1201
1199
|
);
|
|
1202
1200
|
|
|
1203
1201
|
assert(passwordFormFieldState !== undefined);
|
|
1204
1202
|
|
|
1205
|
-
assert(typeof passwordFormFieldState.valueOrValues ===
|
|
1203
|
+
assert(typeof passwordFormFieldState.valueOrValues === 'string');
|
|
1206
1204
|
|
|
1207
1205
|
{
|
|
1208
1206
|
const passwordValue = passwordFormFieldState.valueOrValues;
|
|
@@ -1212,7 +1210,7 @@ export class UserProfileFormService {
|
|
|
1212
1210
|
}
|
|
1213
1211
|
}
|
|
1214
1212
|
|
|
1215
|
-
const msgArgs = [
|
|
1213
|
+
const msgArgs = ['invalidPasswordConfirmMessage'] as const;
|
|
1216
1214
|
|
|
1217
1215
|
errors.push({
|
|
1218
1216
|
errorMessage: this.sanitizer.bypassSecurityTrustHtml(
|
|
@@ -1221,8 +1219,8 @@ export class UserProfileFormService {
|
|
|
1221
1219
|
errorMessageStr: msgStr(...msgArgs),
|
|
1222
1220
|
fieldIndex: undefined,
|
|
1223
1221
|
source: {
|
|
1224
|
-
type:
|
|
1225
|
-
rule:
|
|
1222
|
+
type: 'other',
|
|
1223
|
+
rule: 'passwordConfirmMatchesPassword'
|
|
1226
1224
|
}
|
|
1227
1225
|
});
|
|
1228
1226
|
}
|
|
@@ -1234,11 +1232,11 @@ export class UserProfileFormService {
|
|
|
1234
1232
|
break required_field;
|
|
1235
1233
|
}
|
|
1236
1234
|
|
|
1237
|
-
if (value !==
|
|
1235
|
+
if (value !== '') {
|
|
1238
1236
|
break required_field;
|
|
1239
1237
|
}
|
|
1240
1238
|
|
|
1241
|
-
const msgArgs = [
|
|
1239
|
+
const msgArgs = ['error-user-attribute-required'] as const;
|
|
1242
1240
|
|
|
1243
1241
|
errors.push({
|
|
1244
1242
|
errorMessage: this.sanitizer.bypassSecurityTrustHtml(
|
|
@@ -1247,14 +1245,14 @@ export class UserProfileFormService {
|
|
|
1247
1245
|
errorMessageStr: msgStr(...msgArgs),
|
|
1248
1246
|
fieldIndex: undefined,
|
|
1249
1247
|
source: {
|
|
1250
|
-
type:
|
|
1251
|
-
rule:
|
|
1248
|
+
type: 'other',
|
|
1249
|
+
rule: 'requiredField'
|
|
1252
1250
|
}
|
|
1253
1251
|
});
|
|
1254
1252
|
}
|
|
1255
1253
|
|
|
1256
1254
|
validator_x: {
|
|
1257
|
-
const validatorName =
|
|
1255
|
+
const validatorName = 'length';
|
|
1258
1256
|
|
|
1259
1257
|
const validator = validators[validatorName];
|
|
1260
1258
|
|
|
@@ -1263,22 +1261,22 @@ export class UserProfileFormService {
|
|
|
1263
1261
|
}
|
|
1264
1262
|
|
|
1265
1263
|
const {
|
|
1266
|
-
|
|
1264
|
+
'ignore.empty.value': ignoreEmptyValue = false,
|
|
1267
1265
|
max,
|
|
1268
1266
|
min
|
|
1269
1267
|
} = validator;
|
|
1270
1268
|
|
|
1271
|
-
if (ignoreEmptyValue && value ===
|
|
1269
|
+
if (ignoreEmptyValue && value === '') {
|
|
1272
1270
|
break validator_x;
|
|
1273
1271
|
}
|
|
1274
1272
|
|
|
1275
1273
|
const source: FormFieldError.Source = {
|
|
1276
|
-
type:
|
|
1274
|
+
type: 'validator',
|
|
1277
1275
|
name: validatorName
|
|
1278
1276
|
};
|
|
1279
1277
|
|
|
1280
1278
|
if (max && value.length > parseInt(`${max}`)) {
|
|
1281
|
-
const msgArgs = [
|
|
1279
|
+
const msgArgs = ['error-invalid-length-too-long', `${max}`] as const;
|
|
1282
1280
|
|
|
1283
1281
|
errors.push({
|
|
1284
1282
|
errorMessage: this.sanitizer.bypassSecurityTrustHtml(
|
|
@@ -1291,7 +1289,7 @@ export class UserProfileFormService {
|
|
|
1291
1289
|
}
|
|
1292
1290
|
|
|
1293
1291
|
if (min && value.length < parseInt(`${min}`)) {
|
|
1294
|
-
const msgArgs = [
|
|
1292
|
+
const msgArgs = ['error-invalid-length-too-short', `${min}`] as const;
|
|
1295
1293
|
|
|
1296
1294
|
errors.push({
|
|
1297
1295
|
errorMessage: this.sanitizer.bypassSecurityTrustHtml(
|
|
@@ -1305,7 +1303,7 @@ export class UserProfileFormService {
|
|
|
1305
1303
|
}
|
|
1306
1304
|
|
|
1307
1305
|
validator_x: {
|
|
1308
|
-
const validatorName =
|
|
1306
|
+
const validatorName = 'pattern';
|
|
1309
1307
|
|
|
1310
1308
|
const validator = validators[validatorName];
|
|
1311
1309
|
|
|
@@ -1314,12 +1312,12 @@ export class UserProfileFormService {
|
|
|
1314
1312
|
}
|
|
1315
1313
|
|
|
1316
1314
|
const {
|
|
1317
|
-
|
|
1315
|
+
'ignore.empty.value': ignoreEmptyValue = false,
|
|
1318
1316
|
pattern,
|
|
1319
|
-
|
|
1317
|
+
'error-message': errorMessageKey
|
|
1320
1318
|
} = validator;
|
|
1321
1319
|
|
|
1322
|
-
if (ignoreEmptyValue && value ===
|
|
1320
|
+
if (ignoreEmptyValue && value === '') {
|
|
1323
1321
|
break validator_x;
|
|
1324
1322
|
}
|
|
1325
1323
|
|
|
@@ -1328,7 +1326,7 @@ export class UserProfileFormService {
|
|
|
1328
1326
|
}
|
|
1329
1327
|
|
|
1330
1328
|
const msgArgs = [
|
|
1331
|
-
errorMessageKey ?? id<MessageKey_defaultSet>(
|
|
1329
|
+
errorMessageKey ?? id<MessageKey_defaultSet>('shouldMatchPattern'),
|
|
1332
1330
|
pattern
|
|
1333
1331
|
] as const;
|
|
1334
1332
|
|
|
@@ -1339,7 +1337,7 @@ export class UserProfileFormService {
|
|
|
1339
1337
|
errorMessageStr: advancedMsgStr(...msgArgs),
|
|
1340
1338
|
fieldIndex: undefined,
|
|
1341
1339
|
source: {
|
|
1342
|
-
type:
|
|
1340
|
+
type: 'validator',
|
|
1343
1341
|
name: validatorName
|
|
1344
1342
|
}
|
|
1345
1343
|
});
|
|
@@ -1350,14 +1348,14 @@ export class UserProfileFormService {
|
|
|
1350
1348
|
const lastError = errors[errors.length - 1];
|
|
1351
1349
|
if (
|
|
1352
1350
|
lastError !== undefined &&
|
|
1353
|
-
lastError.source.type ===
|
|
1354
|
-
lastError.source.name ===
|
|
1351
|
+
lastError.source.type === 'validator' &&
|
|
1352
|
+
lastError.source.name === 'pattern'
|
|
1355
1353
|
) {
|
|
1356
1354
|
break validator_x;
|
|
1357
1355
|
}
|
|
1358
1356
|
}
|
|
1359
1357
|
|
|
1360
|
-
const validatorName =
|
|
1358
|
+
const validatorName = 'email';
|
|
1361
1359
|
|
|
1362
1360
|
const validator = validators[validatorName];
|
|
1363
1361
|
|
|
@@ -1365,9 +1363,9 @@ export class UserProfileFormService {
|
|
|
1365
1363
|
break validator_x;
|
|
1366
1364
|
}
|
|
1367
1365
|
|
|
1368
|
-
const {
|
|
1366
|
+
const { 'ignore.empty.value': ignoreEmptyValue = false } = validator;
|
|
1369
1367
|
|
|
1370
|
-
if (ignoreEmptyValue && value ===
|
|
1368
|
+
if (ignoreEmptyValue && value === '') {
|
|
1371
1369
|
break validator_x;
|
|
1372
1370
|
}
|
|
1373
1371
|
|
|
@@ -1375,7 +1373,7 @@ export class UserProfileFormService {
|
|
|
1375
1373
|
break validator_x;
|
|
1376
1374
|
}
|
|
1377
1375
|
|
|
1378
|
-
const msgArgs = [id<MessageKey_defaultSet>(
|
|
1376
|
+
const msgArgs = [id<MessageKey_defaultSet>('invalidEmailMessage')] as const;
|
|
1379
1377
|
|
|
1380
1378
|
errors.push({
|
|
1381
1379
|
errorMessage: this.sanitizer.bypassSecurityTrustHtml(
|
|
@@ -1384,14 +1382,14 @@ export class UserProfileFormService {
|
|
|
1384
1382
|
errorMessageStr: msgStr(...msgArgs),
|
|
1385
1383
|
fieldIndex: undefined,
|
|
1386
1384
|
source: {
|
|
1387
|
-
type:
|
|
1385
|
+
type: 'validator',
|
|
1388
1386
|
name: validatorName
|
|
1389
1387
|
}
|
|
1390
1388
|
});
|
|
1391
1389
|
}
|
|
1392
1390
|
|
|
1393
1391
|
validator_x: {
|
|
1394
|
-
const validatorName =
|
|
1392
|
+
const validatorName = 'integer';
|
|
1395
1393
|
|
|
1396
1394
|
const validator = validators[validatorName];
|
|
1397
1395
|
|
|
@@ -1400,24 +1398,24 @@ export class UserProfileFormService {
|
|
|
1400
1398
|
}
|
|
1401
1399
|
|
|
1402
1400
|
const {
|
|
1403
|
-
|
|
1401
|
+
'ignore.empty.value': ignoreEmptyValue = false,
|
|
1404
1402
|
max,
|
|
1405
1403
|
min
|
|
1406
1404
|
} = validator;
|
|
1407
1405
|
|
|
1408
|
-
if (ignoreEmptyValue && value ===
|
|
1406
|
+
if (ignoreEmptyValue && value === '') {
|
|
1409
1407
|
break validator_x;
|
|
1410
1408
|
}
|
|
1411
1409
|
|
|
1412
1410
|
const intValue = parseInt(value);
|
|
1413
1411
|
|
|
1414
1412
|
const source: FormFieldError.Source = {
|
|
1415
|
-
type:
|
|
1413
|
+
type: 'validator',
|
|
1416
1414
|
name: validatorName
|
|
1417
1415
|
};
|
|
1418
1416
|
|
|
1419
1417
|
if (isNaN(intValue)) {
|
|
1420
|
-
const msgArgs = [
|
|
1418
|
+
const msgArgs = ['mustBeAnInteger'] as const;
|
|
1421
1419
|
|
|
1422
1420
|
errors.push({
|
|
1423
1421
|
errorMessage: this.sanitizer.bypassSecurityTrustHtml(
|
|
@@ -1432,7 +1430,7 @@ export class UserProfileFormService {
|
|
|
1432
1430
|
}
|
|
1433
1431
|
|
|
1434
1432
|
if (max && intValue > parseInt(`${max}`)) {
|
|
1435
|
-
const msgArgs = [
|
|
1433
|
+
const msgArgs = ['error-number-out-of-range-too-big', `${max}`] as const;
|
|
1436
1434
|
|
|
1437
1435
|
errors.push({
|
|
1438
1436
|
errorMessage: this.sanitizer.bypassSecurityTrustHtml(
|
|
@@ -1448,7 +1446,7 @@ export class UserProfileFormService {
|
|
|
1448
1446
|
|
|
1449
1447
|
if (min && intValue < parseInt(`${min}`)) {
|
|
1450
1448
|
const msgArgs = [
|
|
1451
|
-
|
|
1449
|
+
'error-number-out-of-range-too-small',
|
|
1452
1450
|
`${min}`
|
|
1453
1451
|
] as const;
|
|
1454
1452
|
|
|
@@ -1466,7 +1464,7 @@ export class UserProfileFormService {
|
|
|
1466
1464
|
}
|
|
1467
1465
|
|
|
1468
1466
|
validator_x: {
|
|
1469
|
-
const validatorName =
|
|
1467
|
+
const validatorName = 'options';
|
|
1470
1468
|
|
|
1471
1469
|
const validator = validators[validatorName];
|
|
1472
1470
|
|
|
@@ -1474,7 +1472,7 @@ export class UserProfileFormService {
|
|
|
1474
1472
|
break validator_x;
|
|
1475
1473
|
}
|
|
1476
1474
|
|
|
1477
|
-
if (value ===
|
|
1475
|
+
if (value === '') {
|
|
1478
1476
|
break validator_x;
|
|
1479
1477
|
}
|
|
1480
1478
|
|
|
@@ -1482,7 +1480,7 @@ export class UserProfileFormService {
|
|
|
1482
1480
|
break validator_x;
|
|
1483
1481
|
}
|
|
1484
1482
|
|
|
1485
|
-
const msgArgs = [id<MessageKey_defaultSet>(
|
|
1483
|
+
const msgArgs = [id<MessageKey_defaultSet>('notAValidOption')] as const;
|
|
1486
1484
|
|
|
1487
1485
|
errors.push({
|
|
1488
1486
|
errorMessage: this.sanitizer.bypassSecurityTrustHtml(
|
|
@@ -1491,7 +1489,7 @@ export class UserProfileFormService {
|
|
|
1491
1489
|
errorMessageStr: msgStr(...msgArgs),
|
|
1492
1490
|
fieldIndex: undefined,
|
|
1493
1491
|
source: {
|
|
1494
|
-
type:
|
|
1492
|
+
type: 'validator',
|
|
1495
1493
|
name: validatorName
|
|
1496
1494
|
}
|
|
1497
1495
|
});
|