@openedx/frontend-app-authn 1.0.0-alpha.5 → 1.0.0-alpha.6
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/Main.d.ts +3 -0
- package/{src/Main.tsx → dist/Main.js} +4 -15
- package/dist/Main.js.map +1 -0
- package/dist/app.d.ts +3 -0
- package/dist/app.js +41 -0
- package/dist/app.js.map +1 -0
- package/{src → dist}/app.scss +1 -1
- package/dist/base-container/components/default-layout/LargeLayout.d.ts +2 -0
- package/dist/base-container/components/default-layout/LargeLayout.js +11 -0
- package/dist/base-container/components/default-layout/LargeLayout.js.map +1 -0
- package/dist/base-container/components/default-layout/MediumLayout.d.ts +2 -0
- package/dist/base-container/components/default-layout/MediumLayout.js +11 -0
- package/dist/base-container/components/default-layout/MediumLayout.js.map +1 -0
- package/dist/base-container/components/default-layout/SmallLayout.d.ts +2 -0
- package/dist/base-container/components/default-layout/SmallLayout.js +11 -0
- package/dist/base-container/components/default-layout/SmallLayout.js.map +1 -0
- package/dist/base-container/components/default-layout/index.d.ts +3 -0
- package/{src/base-container/components/default-layout/index.jsx → dist/base-container/components/default-layout/index.js} +1 -0
- package/dist/base-container/components/default-layout/index.js.map +1 -0
- package/dist/base-container/components/default-layout/messages.d.ts +13 -0
- package/dist/base-container/components/default-layout/messages.js +15 -0
- package/dist/base-container/components/default-layout/messages.js.map +1 -0
- package/dist/base-container/components/image-layout/ExtraSmallLayout.d.ts +2 -0
- package/dist/base-container/components/image-layout/ExtraSmallLayout.js +10 -0
- package/dist/base-container/components/image-layout/ExtraSmallLayout.js.map +1 -0
- package/dist/base-container/components/image-layout/LargeLayout.d.ts +2 -0
- package/dist/base-container/components/image-layout/LargeLayout.js +11 -0
- package/dist/base-container/components/image-layout/LargeLayout.js.map +1 -0
- package/dist/base-container/components/image-layout/MediumLayout.d.ts +2 -0
- package/dist/base-container/components/image-layout/MediumLayout.js +11 -0
- package/dist/base-container/components/image-layout/MediumLayout.js.map +1 -0
- package/dist/base-container/components/image-layout/SmallLayout.d.ts +2 -0
- package/dist/base-container/components/image-layout/SmallLayout.js +10 -0
- package/dist/base-container/components/image-layout/SmallLayout.js.map +1 -0
- package/dist/base-container/components/image-layout/index.d.ts +4 -0
- package/{src/base-container/components/image-layout/index.jsx → dist/base-container/components/image-layout/index.js} +1 -0
- package/dist/base-container/components/image-layout/index.js.map +1 -0
- package/dist/base-container/components/image-layout/messages.d.ts +13 -0
- package/dist/base-container/components/image-layout/messages.js +15 -0
- package/dist/base-container/components/image-layout/messages.js.map +1 -0
- package/dist/base-container/components/welcome-page-layout/LargeLayout.d.ts +10 -0
- package/dist/base-container/components/welcome-page-layout/LargeLayout.js +14 -0
- package/dist/base-container/components/welcome-page-layout/LargeLayout.js.map +1 -0
- package/dist/base-container/components/welcome-page-layout/MediumLayout.d.ts +10 -0
- package/dist/base-container/components/welcome-page-layout/MediumLayout.js +14 -0
- package/dist/base-container/components/welcome-page-layout/MediumLayout.js.map +1 -0
- package/dist/base-container/components/welcome-page-layout/SmallLayout.d.ts +10 -0
- package/dist/base-container/components/welcome-page-layout/SmallLayout.js +14 -0
- package/dist/base-container/components/welcome-page-layout/SmallLayout.js.map +1 -0
- package/dist/base-container/components/welcome-page-layout/index.d.ts +3 -0
- package/{src/base-container/components/welcome-page-layout/index.jsx → dist/base-container/components/welcome-page-layout/index.js} +1 -0
- package/dist/base-container/components/welcome-page-layout/index.js.map +1 -0
- package/dist/base-container/components/welcome-page-layout/messages.d.ts +18 -0
- package/dist/base-container/components/welcome-page-layout/messages.js +20 -0
- package/dist/base-container/components/welcome-page-layout/messages.js.map +1 -0
- package/dist/base-container/index.d.ts +20 -0
- package/dist/base-container/index.js +27 -0
- package/dist/base-container/index.js.map +1 -0
- package/dist/common-components/EmbeddedRegistrationRoute.d.ts +14 -0
- package/{src/common-components/EmbeddedRegistrationRoute.jsx → dist/common-components/EmbeddedRegistrationRoute.js} +9 -13
- package/dist/common-components/EmbeddedRegistrationRoute.js.map +1 -0
- package/dist/common-components/EnterpriseSSO.d.ts +29 -0
- package/dist/common-components/EnterpriseSSO.js +55 -0
- package/dist/common-components/EnterpriseSSO.js.map +1 -0
- package/dist/common-components/FormGroup.d.ts +60 -0
- package/dist/common-components/FormGroup.js +66 -0
- package/dist/common-components/FormGroup.js.map +1 -0
- package/dist/common-components/InstitutionLogistration.d.ts +34 -0
- package/dist/common-components/InstitutionLogistration.js +38 -0
- package/dist/common-components/InstitutionLogistration.js.map +1 -0
- package/dist/common-components/NotFoundPage.d.ts +2 -0
- package/dist/common-components/NotFoundPage.js +5 -0
- package/dist/common-components/NotFoundPage.js.map +1 -0
- package/dist/common-components/PasswordField.d.ts +39 -0
- package/dist/common-components/PasswordField.js +94 -0
- package/dist/common-components/PasswordField.js.map +1 -0
- package/dist/common-components/RedirectLogistration.d.ts +39 -0
- package/dist/common-components/RedirectLogistration.js +68 -0
- package/dist/common-components/RedirectLogistration.js.map +1 -0
- package/dist/common-components/RegisterFaIcons.d.ts +1 -0
- package/dist/common-components/RegisterFaIcons.js +6 -0
- package/dist/common-components/RegisterFaIcons.js.map +1 -0
- package/dist/common-components/SocialAuthProviders.d.ts +23 -0
- package/dist/common-components/SocialAuthProviders.js +42 -0
- package/dist/common-components/SocialAuthProviders.js.map +1 -0
- package/dist/common-components/ThirdPartyAuth.d.ts +42 -0
- package/dist/common-components/ThirdPartyAuth.js +56 -0
- package/dist/common-components/ThirdPartyAuth.js.map +1 -0
- package/dist/common-components/ThirdPartyAuthAlert.d.ts +15 -0
- package/dist/common-components/ThirdPartyAuthAlert.js +32 -0
- package/dist/common-components/ThirdPartyAuthAlert.js.map +1 -0
- package/dist/common-components/UnAuthOnlyRoute.d.ts +14 -0
- package/dist/common-components/UnAuthOnlyRoute.js +31 -0
- package/dist/common-components/UnAuthOnlyRoute.js.map +1 -0
- package/dist/common-components/data/actions.d.ts +26 -0
- package/{src → dist}/common-components/data/actions.js +8 -13
- package/dist/common-components/data/actions.js.map +1 -0
- package/dist/common-components/data/reducers.d.ts +62 -0
- package/dist/common-components/data/reducers.js +39 -0
- package/dist/common-components/data/reducers.js.map +1 -0
- package/dist/common-components/data/sagas.d.ts +12 -0
- package/dist/common-components/data/sagas.js +21 -0
- package/dist/common-components/data/sagas.js.map +1 -0
- package/dist/common-components/data/selectors.d.ts +98 -0
- package/dist/common-components/data/selectors.js +11 -0
- package/dist/common-components/data/selectors.js.map +1 -0
- package/dist/common-components/data/service.d.ts +5 -0
- package/dist/common-components/data/service.js +31 -0
- package/dist/common-components/data/service.js.map +1 -0
- package/dist/common-components/index.d.ts +13 -0
- package/{src/common-components/index.jsx → dist/common-components/index.js} +1 -0
- package/dist/common-components/index.js.map +1 -0
- package/dist/common-components/messages.d.ts +113 -0
- package/dist/common-components/messages.js +126 -0
- package/dist/common-components/messages.js.map +1 -0
- package/dist/constants.d.ts +1 -0
- package/{src/constants.ts → dist/constants.js} +1 -0
- package/dist/constants.js.map +1 -0
- package/dist/data/configureStore.d.ts +3 -0
- package/{src → dist}/data/configureStore.js +11 -20
- package/dist/data/configureStore.js.map +1 -0
- package/dist/data/constants.d.ts +24 -0
- package/{src → dist}/data/constants.js +4 -8
- package/dist/data/constants.js.map +1 -0
- package/dist/data/countries.d.ts +26 -0
- package/{src/data/countries.ts → dist/data/countries.js} +6 -9
- package/dist/data/countries.js.map +1 -0
- package/dist/data/oneTrust.d.ts +2 -0
- package/dist/data/oneTrust.js +3 -0
- package/dist/data/oneTrust.js.map +1 -0
- package/dist/data/reducers.d.ts +254 -0
- package/dist/data/reducers.js +17 -0
- package/dist/data/reducers.js.map +1 -0
- package/dist/data/sagas.d.ts +1 -0
- package/{src → dist}/data/sagas.js +9 -10
- package/dist/data/sagas.js.map +1 -0
- package/dist/data/utils/cookies.d.ts +1 -0
- package/dist/data/utils/cookies.js +12 -0
- package/dist/data/utils/cookies.js.map +1 -0
- package/dist/data/utils/dataUtils.d.ts +11 -0
- package/dist/data/utils/dataUtils.js +67 -0
- package/dist/data/utils/dataUtils.js.map +1 -0
- package/dist/data/utils/index.d.ts +3 -0
- package/dist/data/utils/index.js +4 -0
- package/dist/data/utils/index.js.map +1 -0
- package/dist/data/utils/reduxUtils.d.ts +15 -0
- package/dist/data/utils/reduxUtils.js +29 -0
- package/dist/data/utils/reduxUtils.js.map +1 -0
- package/dist/data/utils/useMobileResponsive.d.ts +7 -0
- package/dist/data/utils/useMobileResponsive.js +22 -0
- package/dist/data/utils/useMobileResponsive.js.map +1 -0
- package/dist/field-renderer/FieldRenderer.d.ts +34 -0
- package/dist/field-renderer/FieldRenderer.js +70 -0
- package/dist/field-renderer/FieldRenderer.js.map +1 -0
- package/dist/field-renderer/index.d.ts +1 -0
- package/{src/field-renderer/index.jsx → dist/field-renderer/index.js} +1 -0
- package/dist/field-renderer/index.js.map +1 -0
- package/dist/forgot-password/ForgotPasswordAlert.d.ts +16 -0
- package/dist/forgot-password/ForgotPasswordAlert.js +66 -0
- package/dist/forgot-password/ForgotPasswordAlert.js.map +1 -0
- package/dist/forgot-password/ForgotPasswordPage.d.ts +36 -0
- package/dist/forgot-password/ForgotPasswordPage.js +91 -0
- package/dist/forgot-password/ForgotPasswordPage.js.map +1 -0
- package/dist/forgot-password/data/actions.d.ts +30 -0
- package/{src → dist}/forgot-password/data/actions.js +10 -16
- package/dist/forgot-password/data/actions.js.map +1 -0
- package/dist/forgot-password/data/reducers.d.ts +13 -0
- package/dist/forgot-password/data/reducers.js +46 -0
- package/dist/forgot-password/data/reducers.js.map +1 -0
- package/dist/forgot-password/data/sagas.d.ts +4 -0
- package/dist/forgot-password/data/sagas.js +28 -0
- package/dist/forgot-password/data/sagas.js.map +1 -0
- package/dist/forgot-password/data/selectors.d.ts +23 -0
- package/dist/forgot-password/data/selectors.js +5 -0
- package/dist/forgot-password/data/selectors.js.map +1 -0
- package/dist/forgot-password/data/service.d.ts +1 -0
- package/dist/forgot-password/data/service.js +26 -0
- package/dist/forgot-password/data/service.js.map +1 -0
- package/dist/forgot-password/index.d.ts +5 -0
- package/{src → dist}/forgot-password/index.js +1 -0
- package/dist/forgot-password/index.js.map +1 -0
- package/dist/forgot-password/messages.d.ts +123 -0
- package/dist/forgot-password/messages.js +128 -0
- package/dist/forgot-password/messages.js.map +1 -0
- package/dist/i18n/index.d.ts +25 -0
- package/dist/i18n/index.js +26 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/login/AccountActivationMessage.d.ts +14 -0
- package/dist/login/AccountActivationMessage.js +49 -0
- package/dist/login/AccountActivationMessage.js.map +1 -0
- package/dist/login/ChangePasswordPrompt.d.ts +18 -0
- package/dist/login/ChangePasswordPrompt.js +45 -0
- package/dist/login/ChangePasswordPrompt.js.map +1 -0
- package/dist/login/LoginFailure.d.ts +25 -0
- package/dist/login/LoginFailure.js +109 -0
- package/dist/login/LoginFailure.js.map +1 -0
- package/dist/login/LoginPage.d.ts +10 -0
- package/dist/login/LoginPage.js +216 -0
- package/dist/login/LoginPage.js.map +1 -0
- package/dist/login/data/actions.d.ts +36 -0
- package/{src → dist}/login/data/actions.js +12 -19
- package/dist/login/data/actions.js.map +1 -0
- package/dist/login/data/constants.d.ts +17 -0
- package/{src → dist}/login/data/constants.js +4 -4
- package/dist/login/data/constants.js.map +1 -0
- package/dist/login/data/reducers.d.ts +82 -0
- package/dist/login/data/reducers.js +44 -0
- package/dist/login/data/reducers.js.map +1 -0
- package/dist/login/data/sagas.d.ts +10 -0
- package/dist/login/data/sagas.js +34 -0
- package/dist/login/data/sagas.js.map +1 -0
- package/dist/login/data/service.d.ts +4 -0
- package/dist/login/data/service.js +32 -0
- package/dist/login/data/service.js.map +1 -0
- package/dist/login/index.d.ts +4 -0
- package/{src → dist}/login/index.js +1 -1
- package/dist/login/index.js.map +1 -0
- package/dist/login/messages.d.ts +198 -0
- package/dist/login/messages.js +210 -0
- package/dist/login/messages.js.map +1 -0
- package/dist/logistration/Logistration.d.ts +32 -0
- package/dist/logistration/Logistration.js +106 -0
- package/dist/logistration/Logistration.js.map +1 -0
- package/dist/progressive-profiling/ProgressiveProfiling.d.ts +46 -0
- package/dist/progressive-profiling/ProgressiveProfiling.js +167 -0
- package/dist/progressive-profiling/ProgressiveProfiling.js.map +1 -0
- package/dist/progressive-profiling/ProgressiveProfilingPageModal.d.ts +13 -0
- package/dist/progressive-profiling/ProgressiveProfilingPageModal.js +24 -0
- package/dist/progressive-profiling/ProgressiveProfilingPageModal.js.map +1 -0
- package/dist/progressive-profiling/data/actions.d.ts +19 -0
- package/{src → dist}/progressive-profiling/data/actions.js +6 -10
- package/dist/progressive-profiling/data/actions.js.map +1 -0
- package/dist/progressive-profiling/data/reducers.d.ts +22 -0
- package/dist/progressive-profiling/data/reducers.js +23 -0
- package/dist/progressive-profiling/data/reducers.js.map +1 -0
- package/dist/progressive-profiling/data/sagas.d.ts +4 -0
- package/dist/progressive-profiling/data/sagas.js +17 -0
- package/dist/progressive-profiling/data/sagas.js.map +1 -0
- package/dist/progressive-profiling/data/selectors.d.ts +39 -0
- package/{src → dist}/progressive-profiling/data/selectors.js +4 -9
- package/dist/progressive-profiling/data/selectors.js.map +1 -0
- package/dist/progressive-profiling/data/service.d.ts +1 -0
- package/dist/progressive-profiling/data/service.js +23 -0
- package/dist/progressive-profiling/data/service.js.map +1 -0
- package/dist/progressive-profiling/index.d.ts +4 -0
- package/{src → dist}/progressive-profiling/index.js +1 -1
- package/dist/progressive-profiling/index.js.map +1 -0
- package/dist/progressive-profiling/messages.d.ts +53 -0
- package/dist/progressive-profiling/messages.js +57 -0
- package/dist/progressive-profiling/messages.js.map +1 -0
- package/dist/register/RegistrationFields/CountryField/CountryField.d.ts +38 -0
- package/dist/register/RegistrationFields/CountryField/CountryField.js +95 -0
- package/dist/register/RegistrationFields/CountryField/CountryField.js.map +1 -0
- package/dist/register/RegistrationFields/CountryField/validator.d.ts +8 -0
- package/dist/register/RegistrationFields/CountryField/validator.js +29 -0
- package/dist/register/RegistrationFields/CountryField/validator.js.map +1 -0
- package/dist/register/RegistrationFields/EmailField/EmailField.d.ts +30 -0
- package/dist/register/RegistrationFields/EmailField/EmailField.js +80 -0
- package/dist/register/RegistrationFields/EmailField/EmailField.js.map +1 -0
- package/dist/register/RegistrationFields/EmailField/constants.d.ts +3 -0
- package/dist/register/RegistrationFields/EmailField/constants.js +130 -0
- package/dist/register/RegistrationFields/EmailField/constants.js.map +1 -0
- package/dist/register/RegistrationFields/EmailField/validator.d.ts +17 -0
- package/dist/register/RegistrationFields/EmailField/validator.js +107 -0
- package/dist/register/RegistrationFields/EmailField/validator.js.map +1 -0
- package/dist/register/RegistrationFields/HonorCodeField/HonorCode.d.ts +21 -0
- package/dist/register/RegistrationFields/HonorCodeField/HonorCode.js +40 -0
- package/dist/register/RegistrationFields/HonorCodeField/HonorCode.js.map +1 -0
- package/dist/register/RegistrationFields/NameField/NameField.d.ts +29 -0
- package/dist/register/RegistrationFields/NameField/NameField.js +52 -0
- package/dist/register/RegistrationFields/NameField/NameField.js.map +1 -0
- package/dist/register/RegistrationFields/NameField/validator.d.ts +5 -0
- package/{src → dist}/register/RegistrationFields/NameField/validator.js +9 -12
- package/dist/register/RegistrationFields/NameField/validator.js.map +1 -0
- package/dist/register/RegistrationFields/TermsOfServiceField/TermsOfService.d.ts +16 -0
- package/dist/register/RegistrationFields/TermsOfServiceField/TermsOfService.js +24 -0
- package/dist/register/RegistrationFields/TermsOfServiceField/TermsOfService.js.map +1 -0
- package/dist/register/RegistrationFields/UsernameField/UsernameField.d.ts +31 -0
- package/dist/register/RegistrationFields/UsernameField/UsernameField.js +113 -0
- package/dist/register/RegistrationFields/UsernameField/UsernameField.js.map +1 -0
- package/dist/register/RegistrationFields/UsernameField/validator.d.ts +4 -0
- package/dist/register/RegistrationFields/UsernameField/validator.js +15 -0
- package/dist/register/RegistrationFields/UsernameField/validator.js.map +1 -0
- package/dist/register/RegistrationFields/index.d.ts +6 -0
- package/{src → dist}/register/RegistrationFields/index.js +1 -0
- package/dist/register/RegistrationFields/index.js.map +1 -0
- package/dist/register/RegistrationPage.d.ts +18 -0
- package/dist/register/RegistrationPage.js +216 -0
- package/dist/register/RegistrationPage.js.map +1 -0
- package/dist/register/components/ConfigurableRegistrationForm.d.ts +37 -0
- package/dist/register/components/ConfigurableRegistrationForm.js +145 -0
- package/dist/register/components/ConfigurableRegistrationForm.js.map +1 -0
- package/dist/register/components/RegistrationFailure.d.ts +19 -0
- package/dist/register/components/RegistrationFailure.js +57 -0
- package/dist/register/components/RegistrationFailure.js.map +1 -0
- package/dist/register/data/actions.d.ts +80 -0
- package/{src → dist}/register/data/actions.js +26 -42
- package/dist/register/data/actions.js.map +1 -0
- package/dist/register/data/constants.d.ts +10 -0
- package/{src → dist}/register/data/constants.js +4 -4
- package/dist/register/data/constants.js.map +1 -0
- package/dist/register/data/reducers.d.ts +237 -0
- package/dist/register/data/reducers.js +86 -0
- package/dist/register/data/reducers.js.map +1 -0
- package/dist/register/data/sagas.d.ts +19 -0
- package/dist/register/data/sagas.js +45 -0
- package/dist/register/data/sagas.js.map +1 -0
- package/dist/register/data/selectors.d.ts +26 -0
- package/dist/register/data/selectors.js +25 -0
- package/dist/register/data/selectors.js.map +1 -0
- package/dist/register/data/service.d.ts +8 -0
- package/dist/register/data/service.js +46 -0
- package/dist/register/data/service.js.map +1 -0
- package/dist/register/data/utils.d.ts +6 -0
- package/dist/register/data/utils.js +128 -0
- package/dist/register/data/utils.js.map +1 -0
- package/dist/register/index.d.ts +3 -0
- package/{src → dist}/register/index.js +1 -0
- package/dist/register/index.js.map +1 -0
- package/dist/register/messages.d.ts +193 -0
- package/dist/register/messages.js +205 -0
- package/dist/register/messages.js.map +1 -0
- package/dist/reset-password/ResetPasswordFailure.d.ts +15 -0
- package/dist/reset-password/ResetPasswordFailure.js +44 -0
- package/dist/reset-password/ResetPasswordFailure.js.map +1 -0
- package/dist/reset-password/ResetPasswordPage.d.ts +32 -0
- package/dist/reset-password/ResetPasswordPage.js +150 -0
- package/dist/reset-password/ResetPasswordPage.js.map +1 -0
- package/dist/reset-password/ResetPasswordSuccess.d.ts +2 -0
- package/dist/reset-password/ResetPasswordSuccess.js +10 -0
- package/dist/reset-password/ResetPasswordSuccess.js.map +1 -0
- package/dist/reset-password/data/actions.d.ts +56 -0
- package/{src → dist}/reset-password/data/actions.js +17 -26
- package/dist/reset-password/data/actions.js.map +1 -0
- package/dist/reset-password/data/constants.d.ts +13 -0
- package/{src → dist}/reset-password/data/constants.js +6 -7
- package/dist/reset-password/data/constants.js.map +1 -0
- package/dist/reset-password/data/reducers.d.ts +19 -0
- package/dist/reset-password/data/reducers.js +25 -0
- package/dist/reset-password/data/reducers.js.map +1 -0
- package/dist/reset-password/data/sagas.d.ts +7 -0
- package/dist/reset-password/data/sagas.js +63 -0
- package/dist/reset-password/data/sagas.js.map +1 -0
- package/dist/reset-password/data/selectors.d.ts +23 -0
- package/dist/reset-password/data/selectors.js +5 -0
- package/dist/reset-password/data/selectors.js.map +1 -0
- package/dist/reset-password/data/service.d.ts +3 -0
- package/dist/reset-password/data/service.js +62 -0
- package/dist/reset-password/data/service.js.map +1 -0
- package/dist/reset-password/index.d.ts +5 -0
- package/{src → dist}/reset-password/index.js +1 -0
- package/dist/reset-password/index.js.map +1 -0
- package/dist/reset-password/messages.d.ts +83 -0
- package/dist/reset-password/messages.js +87 -0
- package/dist/reset-password/messages.js.map +1 -0
- package/dist/routes.d.ts +18 -0
- package/dist/routes.js +75 -0
- package/dist/routes.js.map +1 -0
- package/package.json +12 -5
- package/src/__mocks__/file.js +0 -1
- package/src/__mocks__/svg.js +0 -1
- package/src/app.ts +0 -43
- package/src/base-container/components/default-layout/DefaultLayout.test.jsx +0 -48
- package/src/base-container/components/default-layout/LargeLayout.jsx +0 -42
- package/src/base-container/components/default-layout/MediumLayout.jsx +0 -49
- package/src/base-container/components/default-layout/SmallLayout.jsx +0 -37
- package/src/base-container/components/default-layout/messages.js +0 -16
- package/src/base-container/components/image-layout/ExtraSmallLayout.jsx +0 -31
- package/src/base-container/components/image-layout/LargeLayout.jsx +0 -32
- package/src/base-container/components/image-layout/MediumLayout.jsx +0 -32
- package/src/base-container/components/image-layout/SmallLayout.jsx +0 -31
- package/src/base-container/components/image-layout/messages.js +0 -16
- package/src/base-container/components/welcome-page-layout/LargeLayout.jsx +0 -46
- package/src/base-container/components/welcome-page-layout/MediumLayout.jsx +0 -49
- package/src/base-container/components/welcome-page-layout/SmallLayout.jsx +0 -38
- package/src/base-container/components/welcome-page-layout/messages.js +0 -21
- package/src/base-container/index.jsx +0 -70
- package/src/base-container/tests/BaseContainer.test.jsx +0 -44
- package/src/common-components/EnterpriseSSO.jsx +0 -110
- package/src/common-components/FormGroup.jsx +0 -106
- package/src/common-components/InstitutionLogistration.jsx +0 -102
- package/src/common-components/NotFoundPage.jsx +0 -15
- package/src/common-components/PasswordField.jsx +0 -175
- package/src/common-components/RedirectLogistration.jsx +0 -94
- package/src/common-components/RegisterFaIcons.jsx +0 -8
- package/src/common-components/SocialAuthProviders.jsx +0 -75
- package/src/common-components/ThirdPartyAuth.jsx +0 -123
- package/src/common-components/ThirdPartyAuthAlert.jsx +0 -49
- package/src/common-components/UnAuthOnlyRoute.jsx +0 -41
- package/src/common-components/data/reducers.js +0 -63
- package/src/common-components/data/sagas.js +0 -32
- package/src/common-components/data/selectors.js +0 -28
- package/src/common-components/data/service.js +0 -23
- package/src/common-components/data/tests/reducer.test.js +0 -82
- package/src/common-components/data/tests/sagas.test.js +0 -71
- package/src/common-components/messages.jsx +0 -127
- package/src/common-components/tests/EmbeddedRegistrationRoute.test.jsx +0 -76
- package/src/common-components/tests/FormField.test.jsx +0 -289
- package/src/common-components/tests/SocialAuthProviders.test.jsx +0 -75
- package/src/common-components/tests/ThirdPartyAuthAlert.test.jsx +0 -39
- package/src/common-components/tests/UnAuthOnlyRoute.test.jsx +0 -73
- package/src/common-components/tests/__snapshots__/SocialAuthProviders.test.jsx.snap +0 -156
- package/src/common-components/tests/__snapshots__/ThirdPartyAuthAlert.test.jsx.snap +0 -53
- package/src/data/oneTrust.js +0 -3
- package/src/data/reducers.js +0 -36
- package/src/data/tests/cookies.test.js +0 -42
- package/src/data/tests/dataUtils.test.js +0 -19
- package/src/data/tests/reduxUtils.test.js +0 -14
- package/src/data/utils/cookies.js +0 -12
- package/src/data/utils/dataUtils.js +0 -81
- package/src/data/utils/index.js +0 -11
- package/src/data/utils/reduxUtils.js +0 -34
- package/src/data/utils/useMobileResponsive.js +0 -24
- package/src/field-renderer/FieldRenderer.jsx +0 -156
- package/src/field-renderer/tests/FieldRenderer.test.jsx +0 -201
- package/src/forgot-password/ForgotPasswordAlert.jsx +0 -97
- package/src/forgot-password/ForgotPasswordPage.jsx +0 -193
- package/src/forgot-password/data/reducers.js +0 -58
- package/src/forgot-password/data/sagas.js +0 -35
- package/src/forgot-password/data/selectors.js +0 -10
- package/src/forgot-password/data/service.js +0 -21
- package/src/forgot-password/data/tests/reducers.test.js +0 -34
- package/src/forgot-password/data/tests/sagas.test.js +0 -67
- package/src/forgot-password/messages.js +0 -128
- package/src/forgot-password/tests/ForgotPasswordPage.test.jsx +0 -269
- package/src/i18n/index.js +0 -25
- package/src/login/AccountActivationMessage.jsx +0 -78
- package/src/login/ChangePasswordPrompt.jsx +0 -91
- package/src/login/LoginFailure.jsx +0 -231
- package/src/login/LoginPage.jsx +0 -368
- package/src/login/data/reducers.js +0 -76
- package/src/login/data/sagas.js +0 -45
- package/src/login/data/service.js +0 -27
- package/src/login/data/tests/reducers.test.js +0 -155
- package/src/login/data/tests/sagas.test.js +0 -110
- package/src/login/messages.jsx +0 -211
- package/src/login/tests/AccountActivationMessage.test.jsx +0 -122
- package/src/login/tests/ChangePasswordPrompt.test.jsx +0 -75
- package/src/login/tests/LoginFailure.test.jsx +0 -323
- package/src/login/tests/LoginPage.test.jsx +0 -839
- package/src/logistration/Logistration.jsx +0 -189
- package/src/logistration/Logistration.test.jsx +0 -275
- package/src/progressive-profiling/ProgressiveProfiling.jsx +0 -313
- package/src/progressive-profiling/ProgressiveProfilingPageModal.jsx +0 -56
- package/src/progressive-profiling/data/reducers.js +0 -38
- package/src/progressive-profiling/data/sagas.js +0 -24
- package/src/progressive-profiling/data/service.js +0 -17
- package/src/progressive-profiling/messages.jsx +0 -57
- package/src/progressive-profiling/tests/ProgressiveProfiling.test.jsx +0 -322
- package/src/register/RegistrationFields/CountryField/CountryField.jsx +0 -164
- package/src/register/RegistrationFields/CountryField/CountryField.test.jsx +0 -204
- package/src/register/RegistrationFields/CountryField/validator.js +0 -32
- package/src/register/RegistrationFields/EmailField/EmailField.jsx +0 -140
- package/src/register/RegistrationFields/EmailField/EmailField.test.jsx +0 -236
- package/src/register/RegistrationFields/EmailField/constants.js +0 -131
- package/src/register/RegistrationFields/EmailField/validator.js +0 -126
- package/src/register/RegistrationFields/EmailField/validator.test.js +0 -39
- package/src/register/RegistrationFields/HonorCodeField/HonorCode.jsx +0 -104
- package/src/register/RegistrationFields/HonorCodeField/HonorCode.test.jsx +0 -70
- package/src/register/RegistrationFields/NameField/NameField.jsx +0 -68
- package/src/register/RegistrationFields/NameField/NameField.test.jsx +0 -146
- package/src/register/RegistrationFields/TermsOfServiceField/TermsOfService.jsx +0 -58
- package/src/register/RegistrationFields/TermsOfServiceField/TermsOfService.test.jsx +0 -55
- package/src/register/RegistrationFields/UsernameField/UsernameField.jsx +0 -162
- package/src/register/RegistrationFields/UsernameField/UsernameField.test.jsx +0 -319
- package/src/register/RegistrationFields/UsernameField/validator.js +0 -16
- package/src/register/RegistrationPage.jsx +0 -428
- package/src/register/RegistrationPage.test.jsx +0 -854
- package/src/register/components/ConfigurableRegistrationForm.jsx +0 -244
- package/src/register/components/RegistrationFailure.jsx +0 -80
- package/src/register/components/tests/ConfigurableRegistrationForm.test.jsx +0 -401
- package/src/register/components/tests/RegistrationFailure.test.jsx +0 -212
- package/src/register/components/tests/ThirdPartyAuth.test.jsx +0 -439
- package/src/register/data/reducers.js +0 -140
- package/src/register/data/sagas.js +0 -58
- package/src/register/data/selectors.js +0 -34
- package/src/register/data/service.js +0 -45
- package/src/register/data/tests/reducers.test.js +0 -277
- package/src/register/data/tests/sagas.test.js +0 -239
- package/src/register/data/tests/utils.test.js +0 -98
- package/src/register/data/utils.js +0 -147
- package/src/register/messages.jsx +0 -206
- package/src/reset-password/ResetPasswordFailure.jsx +0 -55
- package/src/reset-password/ResetPasswordPage.jsx +0 -224
- package/src/reset-password/ResetPasswordSuccess.jsx +0 -19
- package/src/reset-password/data/reducers.js +0 -44
- package/src/reset-password/data/sagas.js +0 -67
- package/src/reset-password/data/selectors.js +0 -10
- package/src/reset-password/data/service.js +0 -61
- package/src/reset-password/data/tests/sagas.test.js +0 -185
- package/src/reset-password/messages.js +0 -88
- package/src/reset-password/tests/ResetPasswordPage.test.jsx +0 -241
- package/src/routes.jsx +0 -79
- package/src/setupTest.js +0 -68
- /package/{src → dist}/base-container/components/image-layout/index.scss +0 -0
- /package/{src/index.ts → dist/index.d.ts} +0 -0
- /package/{src → dist}/sass/_base_component.scss +0 -0
- /package/{src → dist}/sass/_forgot_password.scss +0 -0
- /package/{src → dist}/sass/_login_page.scss +0 -0
- /package/{src → dist}/sass/_progressive_profiling_page.scss +0 -0
- /package/{src → dist}/sass/_registration.scss +0 -0
- /package/{src → dist}/sass/_reset_password.scss +0 -0
- /package/{src → dist}/sass/_style.scss +0 -0
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { snakeCaseObject } from '@openedx/frontend-base';
|
|
2
|
-
|
|
3
|
-
import { LETTER_REGEX, NUMBER_REGEX } from '../../data/constants';
|
|
4
|
-
import messages from '../messages';
|
|
5
|
-
import validateEmail from '../RegistrationFields/EmailField/validator';
|
|
6
|
-
import validateName from '../RegistrationFields/NameField/validator';
|
|
7
|
-
import validateUsername from '../RegistrationFields/UsernameField/validator';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* It validates the password field value
|
|
11
|
-
* @param value
|
|
12
|
-
* @param formatMessage
|
|
13
|
-
* @returns {string}
|
|
14
|
-
*/
|
|
15
|
-
export const validatePasswordField = (value, formatMessage) => {
|
|
16
|
-
let fieldError = '';
|
|
17
|
-
if (!value || !LETTER_REGEX.test(value) || !NUMBER_REGEX.test(value) || value.length < 8) {
|
|
18
|
-
fieldError = formatMessage(messages['password.validation.message']);
|
|
19
|
-
}
|
|
20
|
-
return fieldError;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* It accepts complete registration data as payload and checks if the form is valid.
|
|
25
|
-
* @param payload
|
|
26
|
-
* @param errors
|
|
27
|
-
* @param configurableFormFields
|
|
28
|
-
* @param fieldDescriptions
|
|
29
|
-
* @param formatMessage
|
|
30
|
-
* @returns {{fieldErrors, isValid: boolean}}
|
|
31
|
-
*/
|
|
32
|
-
export const isFormValid = (
|
|
33
|
-
payload,
|
|
34
|
-
errors,
|
|
35
|
-
configurableFormFields,
|
|
36
|
-
fieldDescriptions,
|
|
37
|
-
formatMessage,
|
|
38
|
-
) => {
|
|
39
|
-
const fieldErrors = { ...errors };
|
|
40
|
-
let isValid = true;
|
|
41
|
-
let emailSuggestion = { suggestion: '', type: '' };
|
|
42
|
-
|
|
43
|
-
Object.keys(payload).forEach(key => {
|
|
44
|
-
switch (key) {
|
|
45
|
-
case 'name':
|
|
46
|
-
fieldErrors.name ||= validateName(payload.name, formatMessage);
|
|
47
|
-
if (fieldErrors.name) {
|
|
48
|
-
isValid = false;
|
|
49
|
-
}
|
|
50
|
-
break;
|
|
51
|
-
case 'email': {
|
|
52
|
-
if (!fieldErrors.email) {
|
|
53
|
-
const {
|
|
54
|
-
fieldError, confirmEmailError, suggestion,
|
|
55
|
-
} = validateEmail(payload.email, configurableFormFields?.confirm_email, formatMessage);
|
|
56
|
-
if (fieldError) {
|
|
57
|
-
fieldErrors.email = fieldError;
|
|
58
|
-
isValid = false;
|
|
59
|
-
}
|
|
60
|
-
if (confirmEmailError) {
|
|
61
|
-
fieldErrors.confirm_email = confirmEmailError;
|
|
62
|
-
isValid = false;
|
|
63
|
-
}
|
|
64
|
-
emailSuggestion = suggestion;
|
|
65
|
-
}
|
|
66
|
-
if (fieldErrors.email) {
|
|
67
|
-
isValid = false;
|
|
68
|
-
}
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
case 'username':
|
|
72
|
-
fieldErrors.username ||= validateUsername(payload.username, formatMessage);
|
|
73
|
-
if (fieldErrors.username) {
|
|
74
|
-
isValid = false;
|
|
75
|
-
}
|
|
76
|
-
break;
|
|
77
|
-
case 'password':
|
|
78
|
-
fieldErrors.password ||= validatePasswordField(payload.password, formatMessage);
|
|
79
|
-
if (fieldErrors.password) {
|
|
80
|
-
isValid = false;
|
|
81
|
-
}
|
|
82
|
-
break;
|
|
83
|
-
default:
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
// Don't validate when country field is optional or hidden and not present on registration form
|
|
89
|
-
if (configurableFormFields?.country && !configurableFormFields.country?.displayValue) {
|
|
90
|
-
fieldErrors.country = formatMessage(messages['empty.country.field.error']);
|
|
91
|
-
isValid = false;
|
|
92
|
-
} else if (configurableFormFields?.country && !configurableFormFields.country?.countryCode) {
|
|
93
|
-
fieldErrors.country = formatMessage(messages['invalid.country.field.error']);
|
|
94
|
-
isValid = false;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
Object.keys(fieldDescriptions).forEach(key => {
|
|
98
|
-
if (key === 'country' && !configurableFormFields?.country?.displayValue) {
|
|
99
|
-
fieldErrors[key] = formatMessage(messages['empty.country.field.error']);
|
|
100
|
-
} else if (!configurableFormFields[key]) {
|
|
101
|
-
fieldErrors[key] = fieldDescriptions[key].error_message;
|
|
102
|
-
}
|
|
103
|
-
if (fieldErrors[key]) {
|
|
104
|
-
isValid = false;
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
return { isValid, fieldErrors, emailSuggestion };
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* It prepares a payload for registration data that can be passed to registration API endpoint.
|
|
113
|
-
* @param initPayload
|
|
114
|
-
* @param configurableFormFields
|
|
115
|
-
* @param showMarketingEmailOptInCheckbox
|
|
116
|
-
* @param totalRegistrationTime
|
|
117
|
-
* @param queryParams
|
|
118
|
-
* @returns {*}
|
|
119
|
-
*/
|
|
120
|
-
export const prepareRegistrationPayload = (
|
|
121
|
-
initPayload,
|
|
122
|
-
configurableFormFields,
|
|
123
|
-
showMarketingEmailOptInCheckbox,
|
|
124
|
-
totalRegistrationTime,
|
|
125
|
-
queryParams,
|
|
126
|
-
) => {
|
|
127
|
-
let payload = { ...initPayload };
|
|
128
|
-
Object.keys(configurableFormFields).forEach((fieldName) => {
|
|
129
|
-
if (fieldName === 'country') {
|
|
130
|
-
payload[fieldName] = configurableFormFields[fieldName].countryCode;
|
|
131
|
-
} else {
|
|
132
|
-
payload[fieldName] = configurableFormFields[fieldName];
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
// Don't send the marketing email opt-in value if the flag is turned off
|
|
137
|
-
if (!showMarketingEmailOptInCheckbox) {
|
|
138
|
-
delete payload.marketingEmailsOptIn;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
payload.totalRegistrationTime = totalRegistrationTime;
|
|
142
|
-
payload = snakeCaseObject(payload);
|
|
143
|
-
|
|
144
|
-
// add query params to the payload
|
|
145
|
-
payload = { ...payload, ...queryParams };
|
|
146
|
-
return payload;
|
|
147
|
-
};
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
-
|
|
3
|
-
const messages = defineMessages({
|
|
4
|
-
'register.page.title': {
|
|
5
|
-
id: 'register.page.title',
|
|
6
|
-
defaultMessage: 'Register | {siteName}',
|
|
7
|
-
description: 'register page title',
|
|
8
|
-
},
|
|
9
|
-
// Field labels
|
|
10
|
-
'registration.fullname.label': {
|
|
11
|
-
id: 'registration.fullname.label',
|
|
12
|
-
defaultMessage: 'Full name',
|
|
13
|
-
description: 'Label that appears above fullname field',
|
|
14
|
-
},
|
|
15
|
-
'registration.email.label': {
|
|
16
|
-
id: 'registration.email.label',
|
|
17
|
-
defaultMessage: 'Email',
|
|
18
|
-
description: 'Label that appears above email field on register page',
|
|
19
|
-
},
|
|
20
|
-
'registration.username.label': {
|
|
21
|
-
id: 'registration.username.label',
|
|
22
|
-
defaultMessage: 'Public username',
|
|
23
|
-
description: 'Label that appears above username field',
|
|
24
|
-
},
|
|
25
|
-
'registration.password.label': {
|
|
26
|
-
id: 'registration.password.label',
|
|
27
|
-
defaultMessage: 'Password',
|
|
28
|
-
description: 'Label that appears above password field',
|
|
29
|
-
},
|
|
30
|
-
'registration.country.label': {
|
|
31
|
-
id: 'registration.country.label',
|
|
32
|
-
defaultMessage: 'Country/Region',
|
|
33
|
-
description: 'Placeholder for the country options dropdown.',
|
|
34
|
-
},
|
|
35
|
-
'registration.opt.in.label': {
|
|
36
|
-
id: 'registration.opt.in.label',
|
|
37
|
-
defaultMessage: 'I agree that {siteName} may send me marketing messages.',
|
|
38
|
-
description: 'Text for opt in option on register page.',
|
|
39
|
-
},
|
|
40
|
-
// Help text
|
|
41
|
-
'help.text.name': {
|
|
42
|
-
id: 'help.text.name',
|
|
43
|
-
defaultMessage: 'This name will be used by any certificates that you earn.',
|
|
44
|
-
description: 'Help text for fullname field on registration page',
|
|
45
|
-
},
|
|
46
|
-
'help.text.username.1': {
|
|
47
|
-
id: 'help.text.username.1',
|
|
48
|
-
defaultMessage: 'The name that will identify you in your courses.',
|
|
49
|
-
description: 'Part of help text for username field on registration page',
|
|
50
|
-
},
|
|
51
|
-
'help.text.username.2': {
|
|
52
|
-
id: 'help.text.username.2',
|
|
53
|
-
defaultMessage: 'This can not be changed later.',
|
|
54
|
-
description: 'Part of help text for username field on registration page',
|
|
55
|
-
},
|
|
56
|
-
'help.text.email': {
|
|
57
|
-
id: 'help.text.email',
|
|
58
|
-
defaultMessage: 'For account activation and important updates',
|
|
59
|
-
description: 'Help text for email field on registration page',
|
|
60
|
-
},
|
|
61
|
-
// Form buttons
|
|
62
|
-
'create.account.for.free.button': {
|
|
63
|
-
id: 'create.account.for.free.button',
|
|
64
|
-
defaultMessage: 'Create an account for free',
|
|
65
|
-
description: 'Label text for registration form submission button',
|
|
66
|
-
},
|
|
67
|
-
'create.account.cta.button': {
|
|
68
|
-
id: 'create.account.cta.button',
|
|
69
|
-
defaultMessage: '{label}',
|
|
70
|
-
description: 'Label text for registration form submission button for those users who are landing through redirections',
|
|
71
|
-
},
|
|
72
|
-
// Institution login
|
|
73
|
-
'register.institution.login.page.title': {
|
|
74
|
-
id: 'register.institution.login.page.title',
|
|
75
|
-
defaultMessage: 'Register with institution/campus credentials',
|
|
76
|
-
description: 'Heading of institution page',
|
|
77
|
-
},
|
|
78
|
-
// Validation messages
|
|
79
|
-
'empty.name.field.error': {
|
|
80
|
-
id: 'empty.name.field.error',
|
|
81
|
-
defaultMessage: 'Enter your full name',
|
|
82
|
-
description: 'Error message for empty fullname field',
|
|
83
|
-
},
|
|
84
|
-
'empty.email.field.error': {
|
|
85
|
-
id: 'empty.email.field.error',
|
|
86
|
-
defaultMessage: 'Enter your email',
|
|
87
|
-
description: 'Error message for empty email field',
|
|
88
|
-
},
|
|
89
|
-
'empty.username.field.error': {
|
|
90
|
-
id: 'empty.username.field.error',
|
|
91
|
-
defaultMessage: 'Username must be between 2 and 30 characters',
|
|
92
|
-
description: 'Error message for empty username field',
|
|
93
|
-
},
|
|
94
|
-
'empty.password.field.error': {
|
|
95
|
-
id: 'empty.password.field.error',
|
|
96
|
-
defaultMessage: 'Password criteria has not been met',
|
|
97
|
-
description: 'Error message for empty password field',
|
|
98
|
-
},
|
|
99
|
-
'empty.country.field.error': {
|
|
100
|
-
id: 'empty.country.field.error',
|
|
101
|
-
defaultMessage: 'Select your country or region of residence',
|
|
102
|
-
description: 'Error message when no country/region is selected',
|
|
103
|
-
},
|
|
104
|
-
'invalid.country.field.error': {
|
|
105
|
-
id: 'invalid.country.field.error',
|
|
106
|
-
defaultMessage: 'Country must match with an option available in the dropdown.',
|
|
107
|
-
description: 'Error message when country is invalid',
|
|
108
|
-
},
|
|
109
|
-
'email.do.not.match': {
|
|
110
|
-
id: 'email.do.not.match',
|
|
111
|
-
defaultMessage: 'The email addresses do not match.',
|
|
112
|
-
description: 'Email not match to confirm email',
|
|
113
|
-
},
|
|
114
|
-
'email.invalid.format.error': {
|
|
115
|
-
id: 'email.invalid.format.error',
|
|
116
|
-
defaultMessage: 'Enter a valid email address',
|
|
117
|
-
description: 'Validation error for invalid email address',
|
|
118
|
-
},
|
|
119
|
-
'username.validation.message': {
|
|
120
|
-
id: 'username.validation.message',
|
|
121
|
-
defaultMessage: 'Username must be between 2 and 30 characters',
|
|
122
|
-
description: 'Error message for empty username field',
|
|
123
|
-
},
|
|
124
|
-
'name.validation.message': {
|
|
125
|
-
id: 'name.validation.message',
|
|
126
|
-
defaultMessage: 'Enter a valid name',
|
|
127
|
-
description: 'Validation message that appears when fullname contain URL',
|
|
128
|
-
},
|
|
129
|
-
'password.validation.message': {
|
|
130
|
-
id: 'password.validation.message',
|
|
131
|
-
defaultMessage: 'Password criteria has not been met',
|
|
132
|
-
description: 'Error message for empty or invalid password',
|
|
133
|
-
},
|
|
134
|
-
'username.format.validation.message': {
|
|
135
|
-
id: 'username.format.validation.message',
|
|
136
|
-
defaultMessage: 'Usernames can only contain letters (A-Z, a-z), numerals (0-9), underscores (_), and hyphens (-). Usernames cannot contain spaces',
|
|
137
|
-
description: 'Validation message that appears when username format is invalid',
|
|
138
|
-
},
|
|
139
|
-
// Error messages
|
|
140
|
-
'registration.request.failure.header': {
|
|
141
|
-
id: 'registration.request.failure.header',
|
|
142
|
-
defaultMessage: 'We couldn\'t create your account.',
|
|
143
|
-
description: 'error message when registration failure.',
|
|
144
|
-
},
|
|
145
|
-
'registration.empty.form.submission.error': {
|
|
146
|
-
id: 'registration.empty.form.submission.error',
|
|
147
|
-
defaultMessage: 'Please check your responses and try again.',
|
|
148
|
-
description: 'Error message that appears on top of the form when empty form is submitted',
|
|
149
|
-
},
|
|
150
|
-
'registration.request.server.error': {
|
|
151
|
-
id: 'registration.request.server.error',
|
|
152
|
-
defaultMessage: 'An error has occurred. Try refreshing the page, or check your internet connection.',
|
|
153
|
-
description: 'Error message for internal server error.',
|
|
154
|
-
},
|
|
155
|
-
'registration.rate.limit.error': {
|
|
156
|
-
id: 'registration.rate.limit.error',
|
|
157
|
-
defaultMessage: 'Too many failed registration attempts. Try again later.',
|
|
158
|
-
description: 'Error message that appears when an anonymous user has made too many failed registration attempts',
|
|
159
|
-
},
|
|
160
|
-
'registration.tpa.session.expired': {
|
|
161
|
-
id: 'registration.tpa.session.expired',
|
|
162
|
-
defaultMessage: 'Registration using {provider} has timed out.',
|
|
163
|
-
description: 'Error message that appears when a user has not registered in the required timeframe for the registration method they chose.',
|
|
164
|
-
},
|
|
165
|
-
'registration.tpa.authentication.failure': {
|
|
166
|
-
id: 'registration.tpa.authentication.failure',
|
|
167
|
-
defaultMessage: 'We are sorry, you are not authorized to access {platform_name} via this channel. '
|
|
168
|
-
+ 'Please contact your learning administrator or manager in order to access {platform_name}.'
|
|
169
|
-
+ '{lineBreak}{lineBreak}Error Details:{lineBreak}{errorMessage}',
|
|
170
|
-
description: 'Error message third party authentication pipeline fails',
|
|
171
|
-
},
|
|
172
|
-
// Terms of Service and Honor Code
|
|
173
|
-
'terms.of.service.and.honor.code': {
|
|
174
|
-
id: 'terms.of.service.and.honor.code',
|
|
175
|
-
defaultMessage: 'Terms of Service and Honor Code',
|
|
176
|
-
description: 'Text for the hyperlink that redirects user to terms of service and honor code',
|
|
177
|
-
},
|
|
178
|
-
'privacy.policy': {
|
|
179
|
-
id: 'privacy.policy',
|
|
180
|
-
defaultMessage: 'Privacy Policy',
|
|
181
|
-
description: 'Text for the hyperlink that redirects user to privacy policy',
|
|
182
|
-
},
|
|
183
|
-
'honor.code': {
|
|
184
|
-
id: 'honor.code',
|
|
185
|
-
defaultMessage: 'Honor Code',
|
|
186
|
-
description: 'Text for the hyperlink that redirects user to the honor code',
|
|
187
|
-
},
|
|
188
|
-
'terms.of.service': {
|
|
189
|
-
id: 'terms.of.service',
|
|
190
|
-
defaultMessage: 'Terms of Service',
|
|
191
|
-
description: 'Text for the hyperlink that redirects user to the terms of service',
|
|
192
|
-
},
|
|
193
|
-
// miscellaneous strings
|
|
194
|
-
'registration.username.suggestion.label': {
|
|
195
|
-
id: 'registration.username.suggestion.label',
|
|
196
|
-
defaultMessage: 'Suggested:',
|
|
197
|
-
description: 'Suggested usernames label text.',
|
|
198
|
-
},
|
|
199
|
-
'did.you.mean.alert.text': {
|
|
200
|
-
id: 'did.you.mean.alert.text',
|
|
201
|
-
defaultMessage: 'Did you mean',
|
|
202
|
-
description: 'Did you mean alert suggestion',
|
|
203
|
-
},
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
export default messages;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { useIntl } from '@openedx/frontend-base';
|
|
2
|
-
import { Alert } from '@openedx/paragon';
|
|
3
|
-
import { Error } from '@openedx/paragon/icons';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
|
|
6
|
-
import { FORM_SUBMISSION_ERROR, PASSWORD_RESET, PASSWORD_VALIDATION_ERROR } from './data/constants';
|
|
7
|
-
import messages from './messages';
|
|
8
|
-
|
|
9
|
-
const ResetPasswordFailure = (props) => {
|
|
10
|
-
const { formatMessage } = useIntl();
|
|
11
|
-
const { errorCode, errorMsg } = props;
|
|
12
|
-
|
|
13
|
-
let errorMessage = null;
|
|
14
|
-
let heading = formatMessage(messages['reset.password.failure.heading']);
|
|
15
|
-
switch (errorCode) {
|
|
16
|
-
case PASSWORD_RESET.FORBIDDEN_REQUEST:
|
|
17
|
-
heading = formatMessage(messages['reset.server.rate.limit.error']);
|
|
18
|
-
errorMessage = formatMessage(messages['rate.limit.error']);
|
|
19
|
-
break;
|
|
20
|
-
case PASSWORD_RESET.INTERNAL_SERVER_ERROR:
|
|
21
|
-
errorMessage = formatMessage(messages['internal.server.error']);
|
|
22
|
-
break;
|
|
23
|
-
case PASSWORD_VALIDATION_ERROR:
|
|
24
|
-
errorMessage = errorMsg;
|
|
25
|
-
break;
|
|
26
|
-
case FORM_SUBMISSION_ERROR:
|
|
27
|
-
errorMessage = formatMessage(messages['reset.password.form.submission.error']);
|
|
28
|
-
break;
|
|
29
|
-
default:
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (errorMessage) {
|
|
34
|
-
return (
|
|
35
|
-
<Alert id="validation-errors" className="mb-5" variant="danger" icon={Error}>
|
|
36
|
-
<Alert.Heading>{heading}</Alert.Heading>
|
|
37
|
-
<p>{errorMessage}</p>
|
|
38
|
-
</Alert>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return null;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
ResetPasswordFailure.defaultProps = {
|
|
46
|
-
errorCode: null,
|
|
47
|
-
errorMsg: null,
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
ResetPasswordFailure.propTypes = {
|
|
51
|
-
errorCode: PropTypes.string,
|
|
52
|
-
errorMsg: PropTypes.string,
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export default ResetPasswordFailure;
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import { connect } from 'react-redux';
|
|
3
|
-
|
|
4
|
-
import { getSiteConfig, useIntl } from '@openedx/frontend-base';
|
|
5
|
-
import {
|
|
6
|
-
Form,
|
|
7
|
-
Icon,
|
|
8
|
-
Spinner,
|
|
9
|
-
StatefulButton,
|
|
10
|
-
Tab,
|
|
11
|
-
Tabs,
|
|
12
|
-
} from '@openedx/paragon';
|
|
13
|
-
import { ChevronLeft } from '@openedx/paragon/icons';
|
|
14
|
-
import PropTypes from 'prop-types';
|
|
15
|
-
import { Helmet } from 'react-helmet';
|
|
16
|
-
import { useNavigate, useParams } from 'react-router-dom';
|
|
17
|
-
|
|
18
|
-
import BaseContainer from '../base-container';
|
|
19
|
-
import { PasswordField } from '../common-components';
|
|
20
|
-
import {
|
|
21
|
-
LETTER_REGEX, LOGIN_PAGE, NUMBER_REGEX, RESET_PAGE,
|
|
22
|
-
} from '../data/constants';
|
|
23
|
-
import { getAllPossibleQueryParams, updatePathWithQueryParams, windowScrollTo } from '../data/utils';
|
|
24
|
-
import { resetPassword, validateToken } from './data/actions';
|
|
25
|
-
import {
|
|
26
|
-
FORM_SUBMISSION_ERROR, PASSWORD_RESET_ERROR, PASSWORD_VALIDATION_ERROR, TOKEN_STATE,
|
|
27
|
-
} from './data/constants';
|
|
28
|
-
import { resetPasswordResultSelector } from './data/selectors';
|
|
29
|
-
import { validatePassword } from './data/service';
|
|
30
|
-
import messages from './messages';
|
|
31
|
-
import ResetPasswordFailure from './ResetPasswordFailure';
|
|
32
|
-
|
|
33
|
-
const ResetPasswordPage = (props) => {
|
|
34
|
-
const { formatMessage } = useIntl();
|
|
35
|
-
const newPasswordError = formatMessage(messages['password.validation.message']);
|
|
36
|
-
|
|
37
|
-
const [newPassword, setNewPassword] = useState('');
|
|
38
|
-
const [confirmPassword, setConfirmPassword] = useState('');
|
|
39
|
-
const [formErrors, setFormErrors] = useState({});
|
|
40
|
-
const [errorCode, setErrorCode] = useState(null);
|
|
41
|
-
const { token } = useParams();
|
|
42
|
-
const navigate = useNavigate();
|
|
43
|
-
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (props.status === PASSWORD_RESET_ERROR) {
|
|
46
|
-
navigate(updatePathWithQueryParams(RESET_PAGE));
|
|
47
|
-
}
|
|
48
|
-
if (props.status === 'success') {
|
|
49
|
-
navigate(updatePathWithQueryParams(LOGIN_PAGE));
|
|
50
|
-
}
|
|
51
|
-
if (props.status !== TOKEN_STATE.PENDING) {
|
|
52
|
-
setErrorCode(props.status);
|
|
53
|
-
}
|
|
54
|
-
if (props.status === PASSWORD_VALIDATION_ERROR) {
|
|
55
|
-
setFormErrors({ newPassword: newPasswordError });
|
|
56
|
-
}
|
|
57
|
-
}, [props.status]);
|
|
58
|
-
|
|
59
|
-
const validatePasswordFromBackend = async (password) => {
|
|
60
|
-
let errorMessage = '';
|
|
61
|
-
try {
|
|
62
|
-
const payload = {
|
|
63
|
-
reset_password_page: true,
|
|
64
|
-
password,
|
|
65
|
-
};
|
|
66
|
-
errorMessage = await validatePassword(payload);
|
|
67
|
-
} catch (err) {
|
|
68
|
-
errorMessage = '';
|
|
69
|
-
}
|
|
70
|
-
setFormErrors({ ...formErrors, newPassword: errorMessage });
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
const validateInput = (name, value) => {
|
|
74
|
-
switch (name) {
|
|
75
|
-
case 'newPassword':
|
|
76
|
-
if (!value || !LETTER_REGEX.test(value) || !NUMBER_REGEX.test(value) || value.length < 8) {
|
|
77
|
-
formErrors.newPassword = formatMessage(messages['password.validation.message']);
|
|
78
|
-
} else {
|
|
79
|
-
validatePasswordFromBackend(value);
|
|
80
|
-
}
|
|
81
|
-
break;
|
|
82
|
-
case 'confirmPassword':
|
|
83
|
-
if (!value) {
|
|
84
|
-
formErrors.confirmPassword = formatMessage(messages['confirm.your.password']);
|
|
85
|
-
} else if (value !== newPassword) {
|
|
86
|
-
formErrors.confirmPassword = formatMessage(messages['passwords.do.not.match']);
|
|
87
|
-
} else {
|
|
88
|
-
formErrors.confirmPassword = '';
|
|
89
|
-
}
|
|
90
|
-
break;
|
|
91
|
-
default:
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
setFormErrors({ ...formErrors });
|
|
95
|
-
return !Object.values(formErrors).some(x => (x !== ''));
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const handleOnBlur = (event) => {
|
|
99
|
-
const { name, value } = event.target;
|
|
100
|
-
validateInput(name, value);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const handleConfirmPasswordChange = (e) => {
|
|
104
|
-
const { value } = e.target;
|
|
105
|
-
|
|
106
|
-
setConfirmPassword(value);
|
|
107
|
-
validateInput('confirmPassword', value);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
const handleOnFocus = (e) => {
|
|
111
|
-
setFormErrors({ ...formErrors, [e.target.name]: '' });
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
const handleSubmit = (e) => {
|
|
115
|
-
e.preventDefault();
|
|
116
|
-
|
|
117
|
-
const isPasswordValid = validateInput('newPassword', newPassword);
|
|
118
|
-
const isPasswordConfirmed = validateInput('confirmPassword', confirmPassword);
|
|
119
|
-
|
|
120
|
-
if (isPasswordValid && isPasswordConfirmed) {
|
|
121
|
-
const formPayload = {
|
|
122
|
-
new_password1: newPassword,
|
|
123
|
-
new_password2: confirmPassword,
|
|
124
|
-
};
|
|
125
|
-
const params = getAllPossibleQueryParams();
|
|
126
|
-
props.resetPassword(formPayload, props.token, params);
|
|
127
|
-
} else {
|
|
128
|
-
setErrorCode(FORM_SUBMISSION_ERROR);
|
|
129
|
-
windowScrollTo({ left: 0, top: 0, behavior: 'smooth' });
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
const tabTitle = (
|
|
134
|
-
<div className="d-inline-flex flex-wrap align-items-center">
|
|
135
|
-
<Icon src={ChevronLeft} />
|
|
136
|
-
<span className="ml-2">{formatMessage(messages['sign.in'])}</span>
|
|
137
|
-
</div>
|
|
138
|
-
);
|
|
139
|
-
|
|
140
|
-
if (props.status === TOKEN_STATE.PENDING && token) {
|
|
141
|
-
props.validateToken(token);
|
|
142
|
-
return (
|
|
143
|
-
<Spinner animation="border" variant="primary" className="spinner--position-centered" />
|
|
144
|
-
);
|
|
145
|
-
} else {
|
|
146
|
-
return (
|
|
147
|
-
<BaseContainer>
|
|
148
|
-
<div>
|
|
149
|
-
<Helmet>
|
|
150
|
-
<title>
|
|
151
|
-
{formatMessage(messages['reset.password.page.title'], { siteName: getSiteConfig().siteName })}
|
|
152
|
-
</title>
|
|
153
|
-
</Helmet>
|
|
154
|
-
<Tabs activeKey="" id="controlled-tab" onSelect={(key) => navigate(updatePathWithQueryParams(key))}>
|
|
155
|
-
<Tab title={tabTitle} eventKey={LOGIN_PAGE} />
|
|
156
|
-
</Tabs>
|
|
157
|
-
<div id="main-content" className="main-content">
|
|
158
|
-
<div className="mw-xs">
|
|
159
|
-
<ResetPasswordFailure errorCode={errorCode} errorMsg={props.errorMsg} />
|
|
160
|
-
<h4>{formatMessage(messages['reset.password'])}</h4>
|
|
161
|
-
<p className="mb-4">{formatMessage(messages['reset.password.page.instructions'])}</p>
|
|
162
|
-
<Form id="set-reset-password-form" name="set-reset-password-form">
|
|
163
|
-
<PasswordField
|
|
164
|
-
name="newPassword"
|
|
165
|
-
value={newPassword}
|
|
166
|
-
handleChange={(e) => setNewPassword(e.target.value)}
|
|
167
|
-
handleBlur={handleOnBlur}
|
|
168
|
-
handleFocus={handleOnFocus}
|
|
169
|
-
errorMessage={formErrors.newPassword}
|
|
170
|
-
floatingLabel={formatMessage(messages['new.password.label'])}
|
|
171
|
-
/>
|
|
172
|
-
<PasswordField
|
|
173
|
-
name="confirmPassword"
|
|
174
|
-
value={confirmPassword}
|
|
175
|
-
handleChange={handleConfirmPasswordChange}
|
|
176
|
-
handleFocus={handleOnFocus}
|
|
177
|
-
errorMessage={formErrors.confirmPassword}
|
|
178
|
-
showRequirements={false}
|
|
179
|
-
floatingLabel={formatMessage(messages['confirm.password.label'])}
|
|
180
|
-
/>
|
|
181
|
-
<StatefulButton
|
|
182
|
-
id="submit-new-password"
|
|
183
|
-
name="submit-new-password"
|
|
184
|
-
type="submit"
|
|
185
|
-
variant="brand"
|
|
186
|
-
className="reset-password--button"
|
|
187
|
-
state={props.status}
|
|
188
|
-
labels={{
|
|
189
|
-
default: formatMessage(messages['reset.password']),
|
|
190
|
-
pending: '',
|
|
191
|
-
}}
|
|
192
|
-
onClick={e => handleSubmit(e)}
|
|
193
|
-
onMouseDown={(e) => e.preventDefault()}
|
|
194
|
-
/>
|
|
195
|
-
</Form>
|
|
196
|
-
</div>
|
|
197
|
-
</div>
|
|
198
|
-
</div>
|
|
199
|
-
</BaseContainer>
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
ResetPasswordPage.defaultProps = {
|
|
205
|
-
status: null,
|
|
206
|
-
token: null,
|
|
207
|
-
errorMsg: null,
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
ResetPasswordPage.propTypes = {
|
|
211
|
-
resetPassword: PropTypes.func.isRequired,
|
|
212
|
-
validateToken: PropTypes.func.isRequired,
|
|
213
|
-
token: PropTypes.string,
|
|
214
|
-
status: PropTypes.string,
|
|
215
|
-
errorMsg: PropTypes.string,
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
export default connect(
|
|
219
|
-
resetPasswordResultSelector,
|
|
220
|
-
{
|
|
221
|
-
resetPassword,
|
|
222
|
-
validateToken,
|
|
223
|
-
},
|
|
224
|
-
)(ResetPasswordPage);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useIntl } from '@openedx/frontend-base';
|
|
2
|
-
import { Alert } from '@openedx/paragon';
|
|
3
|
-
|
|
4
|
-
import messages from './messages';
|
|
5
|
-
|
|
6
|
-
const ResetPasswordSuccess = () => {
|
|
7
|
-
const { formatMessage } = useIntl();
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<Alert id="reset-password-success" variant="success" className="mb-5">
|
|
11
|
-
<Alert.Heading>
|
|
12
|
-
{formatMessage(messages['reset.password.success.heading'])}
|
|
13
|
-
</Alert.Heading>
|
|
14
|
-
<p>{formatMessage(messages['reset.password.success'])}</p>
|
|
15
|
-
</Alert>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default ResetPasswordSuccess;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { PASSWORD_RESET_FAILURE, RESET_PASSWORD, VALIDATE_TOKEN } from './actions';
|
|
2
|
-
import { PASSWORD_RESET_ERROR, TOKEN_STATE } from './constants';
|
|
3
|
-
|
|
4
|
-
export const defaultState = {
|
|
5
|
-
status: TOKEN_STATE.PENDING,
|
|
6
|
-
token: null,
|
|
7
|
-
errorMsg: null,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const reducer = (state = defaultState, action = null) => {
|
|
11
|
-
switch (action.type) {
|
|
12
|
-
case VALIDATE_TOKEN.SUCCESS:
|
|
13
|
-
return {
|
|
14
|
-
...state,
|
|
15
|
-
status: TOKEN_STATE.VALID,
|
|
16
|
-
token: action.payload.token,
|
|
17
|
-
};
|
|
18
|
-
case PASSWORD_RESET_FAILURE:
|
|
19
|
-
return {
|
|
20
|
-
...state,
|
|
21
|
-
status: PASSWORD_RESET_ERROR,
|
|
22
|
-
};
|
|
23
|
-
case RESET_PASSWORD.BEGIN:
|
|
24
|
-
return {
|
|
25
|
-
...state,
|
|
26
|
-
status: 'pending',
|
|
27
|
-
};
|
|
28
|
-
case RESET_PASSWORD.SUCCESS:
|
|
29
|
-
return {
|
|
30
|
-
...state,
|
|
31
|
-
status: 'success',
|
|
32
|
-
};
|
|
33
|
-
case RESET_PASSWORD.FAILURE:
|
|
34
|
-
return {
|
|
35
|
-
...state,
|
|
36
|
-
status: action.payload.errorCode,
|
|
37
|
-
errorMsg: action.payload.errorMsg,
|
|
38
|
-
};
|
|
39
|
-
default:
|
|
40
|
-
return state;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export default reducer;
|