@openedx/frontend-app-authn 1.0.0-alpha.4 → 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/dist/app.scss +2 -0
- 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/{src → dist}/sass/_base_component.scss +57 -54
- package/{src → dist}/sass/_progressive_profiling_page.scss +1 -3
- package/{src → dist}/sass/_registration.scss +7 -8
- package/{src → dist}/sass/_style.scss +40 -43
- package/package.json +17 -6
- package/src/__mocks__/file.js +0 -1
- package/src/__mocks__/svg.js +0 -1
- package/src/app.scss +0 -6
- 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 -153
- 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/_forgot_password.scss +0 -0
- /package/{src → dist}/sass/_login_page.scss +0 -0
- /package/{src → dist}/sass/_reset_password.scss +0 -0
|
@@ -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;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { logError, logInfo } from '@openedx/frontend-base';
|
|
2
|
-
import { call, put, takeEvery } from 'redux-saga/effects';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
passwordResetFailure,
|
|
6
|
-
RESET_PASSWORD,
|
|
7
|
-
resetPasswordBegin,
|
|
8
|
-
resetPasswordFailure,
|
|
9
|
-
resetPasswordSuccess,
|
|
10
|
-
VALIDATE_TOKEN,
|
|
11
|
-
validateTokenBegin,
|
|
12
|
-
validateTokenSuccess,
|
|
13
|
-
} from './actions';
|
|
14
|
-
import { PASSWORD_RESET, PASSWORD_VALIDATION_ERROR } from './constants';
|
|
15
|
-
import { resetPassword, validateToken } from './service';
|
|
16
|
-
|
|
17
|
-
// Services
|
|
18
|
-
export function* handleValidateToken(action) {
|
|
19
|
-
try {
|
|
20
|
-
yield put(validateTokenBegin());
|
|
21
|
-
const data = yield call(validateToken, action.payload.token);
|
|
22
|
-
const isValid = data.is_valid;
|
|
23
|
-
if (isValid) {
|
|
24
|
-
yield put(validateTokenSuccess(isValid, action.payload.token));
|
|
25
|
-
} else {
|
|
26
|
-
yield put(passwordResetFailure(PASSWORD_RESET.INVALID_TOKEN));
|
|
27
|
-
}
|
|
28
|
-
} catch (err) {
|
|
29
|
-
if (err.response && err.response.status === 429) {
|
|
30
|
-
yield put(passwordResetFailure(PASSWORD_RESET.FORBIDDEN_REQUEST));
|
|
31
|
-
logInfo(err);
|
|
32
|
-
} else {
|
|
33
|
-
yield put(passwordResetFailure(PASSWORD_RESET.INTERNAL_SERVER_ERROR));
|
|
34
|
-
logError(err);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function* handleResetPassword(action) {
|
|
40
|
-
try {
|
|
41
|
-
yield put(resetPasswordBegin());
|
|
42
|
-
const data = yield call(resetPassword, action.payload.formPayload, action.payload.token, action.payload.params);
|
|
43
|
-
const resetStatus = data.reset_status;
|
|
44
|
-
const resetErrors = data.err_msg;
|
|
45
|
-
|
|
46
|
-
if (resetStatus) {
|
|
47
|
-
yield put(resetPasswordSuccess(resetStatus));
|
|
48
|
-
} else if (data.token_invalid) {
|
|
49
|
-
yield put(passwordResetFailure(PASSWORD_RESET.INVALID_TOKEN));
|
|
50
|
-
} else {
|
|
51
|
-
yield put(resetPasswordFailure(PASSWORD_VALIDATION_ERROR, resetErrors));
|
|
52
|
-
}
|
|
53
|
-
} catch (err) {
|
|
54
|
-
if (err.response && err.response.status === 429) {
|
|
55
|
-
yield put(resetPasswordFailure(PASSWORD_RESET.FORBIDDEN_REQUEST));
|
|
56
|
-
logInfo(err);
|
|
57
|
-
} else {
|
|
58
|
-
yield put(resetPasswordFailure(PASSWORD_RESET.INTERNAL_SERVER_ERROR));
|
|
59
|
-
logError(err);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export default function* saga() {
|
|
65
|
-
yield takeEvery(RESET_PASSWORD.BASE, handleResetPassword);
|
|
66
|
-
yield takeEvery(VALIDATE_TOKEN.BASE, handleValidateToken);
|
|
67
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createSelector } from 'reselect';
|
|
2
|
-
|
|
3
|
-
export const storeName = 'resetPassword';
|
|
4
|
-
|
|
5
|
-
export const resetPasswordSelector = state => ({ ...state[storeName] });
|
|
6
|
-
|
|
7
|
-
export const resetPasswordResultSelector = createSelector(
|
|
8
|
-
resetPasswordSelector,
|
|
9
|
-
resetPassword => resetPassword,
|
|
10
|
-
);
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { getSiteConfig, getHttpClient } from '@openedx/frontend-base';
|
|
2
|
-
import formurlencoded from 'form-urlencoded';
|
|
3
|
-
|
|
4
|
-
export async function validateToken(token) {
|
|
5
|
-
const requestConfig = {
|
|
6
|
-
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const { data } = await getHttpClient()
|
|
10
|
-
.post(
|
|
11
|
-
`${getSiteConfig().lmsBaseUrl}/user_api/v1/account/password_reset/token/validate/`,
|
|
12
|
-
formurlencoded({ token }),
|
|
13
|
-
requestConfig,
|
|
14
|
-
)
|
|
15
|
-
.catch((e) => {
|
|
16
|
-
throw (e);
|
|
17
|
-
});
|
|
18
|
-
return data;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export async function resetPassword(payload, token, queryParams) {
|
|
22
|
-
const requestConfig = {
|
|
23
|
-
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
24
|
-
};
|
|
25
|
-
const url = new URL(`${getSiteConfig().lmsBaseUrl}/password/reset/${token}/`);
|
|
26
|
-
|
|
27
|
-
if (queryParams.is_account_recovery) {
|
|
28
|
-
url.searchParams.append('is_account_recovery', true);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const { data } = await getHttpClient()
|
|
32
|
-
.post(url.href, formurlencoded(payload), requestConfig)
|
|
33
|
-
.catch((e) => {
|
|
34
|
-
throw (e);
|
|
35
|
-
});
|
|
36
|
-
return data;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export async function validatePassword(payload) {
|
|
40
|
-
const requestConfig = {
|
|
41
|
-
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
42
|
-
};
|
|
43
|
-
const { data } = await getHttpClient()
|
|
44
|
-
.post(
|
|
45
|
-
`${getSiteConfig().lmsBaseUrl}/api/user/v1/validation/registration`,
|
|
46
|
-
formurlencoded(payload),
|
|
47
|
-
requestConfig,
|
|
48
|
-
)
|
|
49
|
-
.catch((e) => {
|
|
50
|
-
throw (e);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
let errorMessage = '';
|
|
54
|
-
// Be careful about grabbing this message, since we could have received an HTTP error or the
|
|
55
|
-
// endpoint didn't give us what we expect. We only care if we get a clear error message.
|
|
56
|
-
if (data.validation_decisions?.password) {
|
|
57
|
-
errorMessage = data.validation_decisions.password;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return errorMessage;
|
|
61
|
-
}
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { runSaga } from 'redux-saga';
|
|
2
|
-
|
|
3
|
-
import { initializeMockServices } from '../../../setupTest';
|
|
4
|
-
import {
|
|
5
|
-
passwordResetFailure,
|
|
6
|
-
resetPasswordBegin,
|
|
7
|
-
resetPasswordFailure,
|
|
8
|
-
resetPasswordSuccess, validateTokenBegin,
|
|
9
|
-
} from '../actions';
|
|
10
|
-
import { PASSWORD_RESET } from '../constants';
|
|
11
|
-
import { handleResetPassword, handleValidateToken } from '../sagas';
|
|
12
|
-
import * as api from '../service';
|
|
13
|
-
|
|
14
|
-
const { loggingService } = initializeMockServices();
|
|
15
|
-
|
|
16
|
-
describe('handleResetPassword', () => {
|
|
17
|
-
const params = {
|
|
18
|
-
payload: {
|
|
19
|
-
formPayload: {
|
|
20
|
-
new_password1: 'new_password1',
|
|
21
|
-
new_password2: 'new_password1',
|
|
22
|
-
},
|
|
23
|
-
token: 'token',
|
|
24
|
-
params: {},
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const responseData = {
|
|
29
|
-
reset_status: true,
|
|
30
|
-
err_msg: '',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
beforeEach(() => {
|
|
34
|
-
loggingService.logError.mockReset();
|
|
35
|
-
loggingService.logInfo.mockReset();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('should call service and dispatch success action', async () => {
|
|
39
|
-
const resetPassword = jest.spyOn(api, 'resetPassword')
|
|
40
|
-
.mockImplementation(() => Promise.resolve(responseData));
|
|
41
|
-
|
|
42
|
-
const dispatched = [];
|
|
43
|
-
await runSaga(
|
|
44
|
-
{ dispatch: (action) => dispatched.push(action) },
|
|
45
|
-
handleResetPassword,
|
|
46
|
-
params,
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
expect(resetPassword).toHaveBeenCalledTimes(1);
|
|
50
|
-
expect(dispatched).toEqual([resetPasswordBegin(), resetPasswordSuccess(true)]);
|
|
51
|
-
resetPassword.mockClear();
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('should call service and dispatch internal server error action', async () => {
|
|
55
|
-
const errorResponse = {
|
|
56
|
-
response: {
|
|
57
|
-
status: 500,
|
|
58
|
-
data: {
|
|
59
|
-
errorCode: PASSWORD_RESET.INTERNAL_SERVER_ERROR,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
const resetPassword = jest.spyOn(api, 'resetPassword')
|
|
64
|
-
.mockImplementation(() => Promise.reject(errorResponse));
|
|
65
|
-
|
|
66
|
-
const dispatched = [];
|
|
67
|
-
await runSaga(
|
|
68
|
-
{ dispatch: (action) => dispatched.push(action) },
|
|
69
|
-
handleResetPassword,
|
|
70
|
-
params,
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
expect(loggingService.logError).toHaveBeenCalled();
|
|
74
|
-
expect(resetPassword).toHaveBeenCalledTimes(1);
|
|
75
|
-
expect(dispatched).toEqual([resetPasswordBegin(), resetPasswordFailure(PASSWORD_RESET.INTERNAL_SERVER_ERROR)]);
|
|
76
|
-
resetPassword.mockClear();
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should call service and dispatch invalid token error', async () => {
|
|
80
|
-
responseData.reset_status = false;
|
|
81
|
-
responseData.token_invalid = true;
|
|
82
|
-
|
|
83
|
-
const resetPassword = jest.spyOn(api, 'resetPassword')
|
|
84
|
-
.mockImplementation(() => Promise.resolve(responseData));
|
|
85
|
-
|
|
86
|
-
const dispatched = [];
|
|
87
|
-
await runSaga(
|
|
88
|
-
{ dispatch: (action) => dispatched.push(action) },
|
|
89
|
-
handleResetPassword,
|
|
90
|
-
params,
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
expect(resetPassword).toHaveBeenCalledTimes(1);
|
|
94
|
-
expect(dispatched).toEqual([resetPasswordBegin(), passwordResetFailure(PASSWORD_RESET.INVALID_TOKEN)]);
|
|
95
|
-
resetPassword.mockClear();
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it('should call service and dispatch ratelimit error', async () => {
|
|
99
|
-
const errorResponse = {
|
|
100
|
-
response: {
|
|
101
|
-
status: 429,
|
|
102
|
-
data: {
|
|
103
|
-
errorCode: PASSWORD_RESET.FORBIDDEN_REQUEST,
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
const resetPassword = jest.spyOn(api, 'resetPassword')
|
|
108
|
-
.mockImplementation(() => Promise.reject(errorResponse));
|
|
109
|
-
|
|
110
|
-
const dispatched = [];
|
|
111
|
-
await runSaga(
|
|
112
|
-
{ dispatch: (action) => dispatched.push(action) },
|
|
113
|
-
handleResetPassword,
|
|
114
|
-
params,
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
expect(loggingService.logInfo).toHaveBeenCalled();
|
|
118
|
-
expect(resetPassword).toHaveBeenCalledTimes(1);
|
|
119
|
-
expect(dispatched).toEqual([resetPasswordBegin(), resetPasswordFailure(PASSWORD_RESET.FORBIDDEN_REQUEST)]);
|
|
120
|
-
resetPassword.mockClear();
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
describe('handleValidateToken', () => {
|
|
125
|
-
const params = {
|
|
126
|
-
payload: {
|
|
127
|
-
token: 'token',
|
|
128
|
-
params: {},
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
beforeEach(() => {
|
|
133
|
-
loggingService.logError.mockReset();
|
|
134
|
-
loggingService.logInfo.mockReset();
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
it('check internal server error on api failure', async () => {
|
|
138
|
-
const errorResponse = {
|
|
139
|
-
response: {
|
|
140
|
-
status: 500,
|
|
141
|
-
data: {
|
|
142
|
-
errorCode: PASSWORD_RESET.INTERNAL_SERVER_ERROR,
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
const validateToken = jest.spyOn(api, 'validateToken')
|
|
147
|
-
.mockImplementation(() => Promise.reject(errorResponse));
|
|
148
|
-
|
|
149
|
-
const dispatched = [];
|
|
150
|
-
await runSaga(
|
|
151
|
-
{ dispatch: (action) => dispatched.push(action) },
|
|
152
|
-
handleValidateToken,
|
|
153
|
-
params,
|
|
154
|
-
);
|
|
155
|
-
|
|
156
|
-
expect(validateToken).toHaveBeenCalledTimes(1);
|
|
157
|
-
expect(dispatched).toEqual([validateTokenBegin(), passwordResetFailure(PASSWORD_RESET.INTERNAL_SERVER_ERROR)]);
|
|
158
|
-
validateToken.mockClear();
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
it('should call service and dispatch rate limit error', async () => {
|
|
162
|
-
const errorResponse = {
|
|
163
|
-
response: {
|
|
164
|
-
status: 429,
|
|
165
|
-
data: {
|
|
166
|
-
errorCode: PASSWORD_RESET.FORBIDDEN_REQUEST,
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
};
|
|
170
|
-
const validateToken = jest.spyOn(api, 'validateToken')
|
|
171
|
-
.mockImplementation(() => Promise.reject(errorResponse));
|
|
172
|
-
|
|
173
|
-
const dispatched = [];
|
|
174
|
-
await runSaga(
|
|
175
|
-
{ dispatch: (action) => dispatched.push(action) },
|
|
176
|
-
handleValidateToken,
|
|
177
|
-
params,
|
|
178
|
-
);
|
|
179
|
-
|
|
180
|
-
expect(loggingService.logInfo).toHaveBeenCalled();
|
|
181
|
-
expect(validateToken).toHaveBeenCalledTimes(1);
|
|
182
|
-
expect(dispatched).toEqual([validateTokenBegin(), passwordResetFailure(PASSWORD_RESET.FORBIDDEN_REQUEST)]);
|
|
183
|
-
validateToken.mockClear();
|
|
184
|
-
});
|
|
185
|
-
});
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
-
|
|
3
|
-
const messages = defineMessages({
|
|
4
|
-
'sign.in': {
|
|
5
|
-
id: 'sign.in',
|
|
6
|
-
defaultMessage: 'Sign in',
|
|
7
|
-
description: 'Sign in toggle text',
|
|
8
|
-
},
|
|
9
|
-
'reset.password.page.title': {
|
|
10
|
-
id: 'reset.password.page.title',
|
|
11
|
-
defaultMessage: 'Reset Password | {siteName}',
|
|
12
|
-
description: 'page title',
|
|
13
|
-
},
|
|
14
|
-
'reset.password': {
|
|
15
|
-
id: 'reset.password',
|
|
16
|
-
defaultMessage: 'Reset password',
|
|
17
|
-
description: 'The page heading and button text for reset password page.',
|
|
18
|
-
},
|
|
19
|
-
'reset.password.page.instructions': {
|
|
20
|
-
id: 'reset.password.page.instructions',
|
|
21
|
-
defaultMessage: 'Enter and confirm your new password.',
|
|
22
|
-
description: 'Instructions message for reset password page.',
|
|
23
|
-
},
|
|
24
|
-
'new.password.label': {
|
|
25
|
-
id: 'new.password.label',
|
|
26
|
-
defaultMessage: 'New password',
|
|
27
|
-
description: 'New password field label for the reset password page.',
|
|
28
|
-
},
|
|
29
|
-
'confirm.password.label': {
|
|
30
|
-
id: 'confirm.password.label',
|
|
31
|
-
defaultMessage: 'Confirm password',
|
|
32
|
-
description: 'Confirm password field label for the reset password page.',
|
|
33
|
-
},
|
|
34
|
-
// validation errors
|
|
35
|
-
'password.validation.message': {
|
|
36
|
-
id: 'password.validation.message',
|
|
37
|
-
defaultMessage: 'Password criteria has not been met',
|
|
38
|
-
description: 'Error message for empty or invalid password',
|
|
39
|
-
},
|
|
40
|
-
'passwords.do.not.match': {
|
|
41
|
-
id: 'passwords.do.not.match',
|
|
42
|
-
defaultMessage: 'Passwords do not match',
|
|
43
|
-
description: 'Password format error.',
|
|
44
|
-
},
|
|
45
|
-
'confirm.your.password': {
|
|
46
|
-
id: 'confirm.your.password',
|
|
47
|
-
defaultMessage: 'Confirm your password',
|
|
48
|
-
description: 'Field validation message when confirm password is empty',
|
|
49
|
-
},
|
|
50
|
-
// alert banner strings
|
|
51
|
-
'reset.password.failure.heading': {
|
|
52
|
-
id: 'reset.password.failure.heading',
|
|
53
|
-
defaultMessage: 'We couldn\'t reset your password.',
|
|
54
|
-
description: 'Heading for reset password request failure',
|
|
55
|
-
},
|
|
56
|
-
'reset.password.form.submission.error': {
|
|
57
|
-
id: 'reset.password.form.submission.error',
|
|
58
|
-
defaultMessage: 'Please check your responses and try again.',
|
|
59
|
-
description: 'Error message for reset password page',
|
|
60
|
-
},
|
|
61
|
-
'reset.server.rate.limit.error': {
|
|
62
|
-
id: 'reset.server.rate.limit.error',
|
|
63
|
-
defaultMessage: 'Too many requests.',
|
|
64
|
-
description: 'Too many request at server end point',
|
|
65
|
-
},
|
|
66
|
-
'reset.password.success.heading': {
|
|
67
|
-
id: 'reset.password.success.heading',
|
|
68
|
-
defaultMessage: 'Password reset complete.',
|
|
69
|
-
description: 'Heading for alert box when reset password is successful',
|
|
70
|
-
},
|
|
71
|
-
'reset.password.success': {
|
|
72
|
-
id: 'reset.password.success',
|
|
73
|
-
defaultMessage: 'Your password has been reset. Sign in to your account.',
|
|
74
|
-
description: 'Reset password success message',
|
|
75
|
-
},
|
|
76
|
-
'internal.server.error': {
|
|
77
|
-
id: 'internal.server.error',
|
|
78
|
-
defaultMessage: 'An error has occurred. Try refreshing the page, or check your internet connection.',
|
|
79
|
-
description: 'Error message that appears when server responds with 500 error code',
|
|
80
|
-
},
|
|
81
|
-
'rate.limit.error': {
|
|
82
|
-
id: 'rate.limit.error',
|
|
83
|
-
defaultMessage: 'An error has occurred because of too many requests. Please try again after some time.',
|
|
84
|
-
description: 'Error message that appears when server responds with 429 error code',
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
export default messages;
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import { Provider } from 'react-redux';
|
|
2
|
-
|
|
3
|
-
import { CurrentAppProvider, configureI18n, getSiteConfig, injectIntl, IntlProvider } from '@openedx/frontend-base';
|
|
4
|
-
import {
|
|
5
|
-
fireEvent, render, screen,
|
|
6
|
-
} from '@testing-library/react';
|
|
7
|
-
import { act } from 'react-dom/test-utils';
|
|
8
|
-
import { MemoryRouter, useParams } from 'react-router-dom';
|
|
9
|
-
import configureStore from 'redux-mock-store';
|
|
10
|
-
|
|
11
|
-
import { appId } from '../../constants';
|
|
12
|
-
import { initializeMockServices } from '../../setupTest';
|
|
13
|
-
import { LOGIN_PAGE, RESET_PAGE } from '../../data/constants';
|
|
14
|
-
import { resetPassword, validateToken } from '../data/actions';
|
|
15
|
-
import {
|
|
16
|
-
PASSWORD_RESET, PASSWORD_RESET_ERROR, SUCCESS, TOKEN_STATE,
|
|
17
|
-
} from '../data/constants';
|
|
18
|
-
import ResetPasswordPage from '../ResetPasswordPage';
|
|
19
|
-
|
|
20
|
-
const mockNavigate = jest.fn();
|
|
21
|
-
const mockParams = jest.fn();
|
|
22
|
-
jest.mock('react-router-dom', () => ({
|
|
23
|
-
...jest.requireActual('react-router-dom'),
|
|
24
|
-
useNavigate: () => mockNavigate,
|
|
25
|
-
useParams: jest.fn(),
|
|
26
|
-
}));
|
|
27
|
-
|
|
28
|
-
initializeMockServices();
|
|
29
|
-
const IntlResetPasswordPage = injectIntl(ResetPasswordPage);
|
|
30
|
-
const mockStore = configureStore();
|
|
31
|
-
const token = '1c-bmjdkc-5e60e084cf8113048ca7';
|
|
32
|
-
|
|
33
|
-
describe('ResetPasswordPage', () => {
|
|
34
|
-
let props = {};
|
|
35
|
-
let store = {};
|
|
36
|
-
|
|
37
|
-
const reduxWrapper = children => (
|
|
38
|
-
<IntlProvider locale="en">
|
|
39
|
-
<MemoryRouter>
|
|
40
|
-
<CurrentAppProvider appId={appId}>
|
|
41
|
-
<Provider store={store}>{children}</Provider>
|
|
42
|
-
</CurrentAppProvider>
|
|
43
|
-
</MemoryRouter>
|
|
44
|
-
</IntlProvider>
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
const initialState = {
|
|
48
|
-
register: {
|
|
49
|
-
validationApiRateLimited: false,
|
|
50
|
-
},
|
|
51
|
-
resetPassword: {},
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
beforeEach(() => {
|
|
55
|
-
store = mockStore(initialState);
|
|
56
|
-
configureI18n({
|
|
57
|
-
messages: { 'es-419': {}, de: {}, 'en-us': {} },
|
|
58
|
-
});
|
|
59
|
-
props = {
|
|
60
|
-
resetPassword: jest.fn(),
|
|
61
|
-
status: null,
|
|
62
|
-
token: null,
|
|
63
|
-
errors: null,
|
|
64
|
-
match: {
|
|
65
|
-
params: {},
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
useParams.mockReturnValue({ token: null });
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
afterEach(() => {
|
|
72
|
-
jest.clearAllMocks();
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
// ******** form submission tests ********
|
|
76
|
-
|
|
77
|
-
it('with valid inputs resetPassword action is dispatched', async () => {
|
|
78
|
-
const password = 'test-password-1';
|
|
79
|
-
|
|
80
|
-
store = mockStore({
|
|
81
|
-
...initialState,
|
|
82
|
-
resetPassword: {
|
|
83
|
-
status: TOKEN_STATE.VALID,
|
|
84
|
-
},
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
store.dispatch = jest.fn(store.dispatch);
|
|
88
|
-
render(reduxWrapper(<IntlResetPasswordPage {...props} />));
|
|
89
|
-
const newPasswordInput = screen.getByLabelText('New password');
|
|
90
|
-
const confirmPasswordInput = screen.getByLabelText('Confirm password');
|
|
91
|
-
|
|
92
|
-
fireEvent.change(newPasswordInput, { target: { value: password } });
|
|
93
|
-
fireEvent.change(confirmPasswordInput, { target: { value: password } });
|
|
94
|
-
|
|
95
|
-
const resetPasswordButton = screen.getByRole('button', { name: /Reset password/i, id: 'submit-new-password' });
|
|
96
|
-
await act(async () => {
|
|
97
|
-
fireEvent.click(resetPasswordButton);
|
|
98
|
-
});
|
|
99
|
-
expect(store.dispatch).toHaveBeenCalledWith(
|
|
100
|
-
resetPassword({ new_password1: password, new_password2: password }, props.token, {}),
|
|
101
|
-
);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
// ******** test reset password field validations ********
|
|
105
|
-
|
|
106
|
-
it('should show error messages for required fields on empty form submission', () => {
|
|
107
|
-
store = mockStore({
|
|
108
|
-
...initialState,
|
|
109
|
-
resetPassword: {
|
|
110
|
-
status: TOKEN_STATE.VALID,
|
|
111
|
-
},
|
|
112
|
-
});
|
|
113
|
-
render(reduxWrapper(<IntlResetPasswordPage {...props} />));
|
|
114
|
-
const resetPasswordButton = screen.getByRole('button', { name: /Reset password/i, id: 'submit-new-password' });
|
|
115
|
-
fireEvent.click(resetPasswordButton);
|
|
116
|
-
|
|
117
|
-
expect(screen.queryByText(/We couldn't reset your password./i)).toBeTruthy();
|
|
118
|
-
expect(screen.queryByText('Password criteria has not been met')).toBeTruthy();
|
|
119
|
-
expect(screen.queryByText('Confirm your password')).toBeTruthy();
|
|
120
|
-
|
|
121
|
-
const newPasswordInput = screen.getByLabelText('New password');
|
|
122
|
-
fireEvent.focus(newPasswordInput);
|
|
123
|
-
expect(screen.queryByText('Password criteria has not been met')).toBeNull();
|
|
124
|
-
|
|
125
|
-
const confirmPasswordInput = screen.getByLabelText('Confirm password');
|
|
126
|
-
fireEvent.focus(confirmPasswordInput);
|
|
127
|
-
expect(screen.queryByText('Confirm your password')).toBeNull();
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
it('should show error message when new and confirm password do not match', () => {
|
|
131
|
-
store = mockStore({
|
|
132
|
-
...initialState,
|
|
133
|
-
resetPassword: {
|
|
134
|
-
status: TOKEN_STATE.VALID,
|
|
135
|
-
},
|
|
136
|
-
});
|
|
137
|
-
render(reduxWrapper(<IntlResetPasswordPage {...props} />));
|
|
138
|
-
const confirmPasswordInput = screen.getByLabelText('Confirm password');
|
|
139
|
-
fireEvent.change(confirmPasswordInput, { target: { value: 'password-mismatch' } });
|
|
140
|
-
|
|
141
|
-
const passwordsDoNotMatchError = screen.queryByText('Passwords do not match');
|
|
142
|
-
expect(passwordsDoNotMatchError).toBeTruthy();
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
// ******** alert message tests ********
|
|
146
|
-
|
|
147
|
-
it('should show reset password rate limit error', () => {
|
|
148
|
-
const validationMessage = 'Too many requests.An error has occurred because of too many requests. Please try again after some time.';
|
|
149
|
-
store = mockStore({
|
|
150
|
-
...initialState,
|
|
151
|
-
resetPassword: {
|
|
152
|
-
status: PASSWORD_RESET.FORBIDDEN_REQUEST,
|
|
153
|
-
},
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
const { container } = render(reduxWrapper(<IntlResetPasswordPage {...props} />));
|
|
157
|
-
|
|
158
|
-
const alertElements = container.querySelectorAll('.alert-danger');
|
|
159
|
-
const rateLimitError = alertElements[0].textContent;
|
|
160
|
-
expect(rateLimitError).toBe(validationMessage);
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
it('should show reset password internal server error', () => {
|
|
164
|
-
const validationMessage = 'We couldn\'t reset your password.An error has occurred. Try refreshing the page, or check your internet connection.';
|
|
165
|
-
store = mockStore({
|
|
166
|
-
...initialState,
|
|
167
|
-
resetPassword: {
|
|
168
|
-
status: PASSWORD_RESET.INTERNAL_SERVER_ERROR,
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
const { container } = render(reduxWrapper(<IntlResetPasswordPage {...props} />));
|
|
173
|
-
const alertElements = container.querySelectorAll('.alert-danger');
|
|
174
|
-
const internalServerError = alertElements[0].textContent;
|
|
175
|
-
expect(internalServerError).toBe(validationMessage);
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
// ******** miscellaneous tests ********
|
|
179
|
-
|
|
180
|
-
it('should call validation on password field when blur event fires', () => {
|
|
181
|
-
const resetPasswordPage = render(reduxWrapper(<IntlResetPasswordPage {...props} />));
|
|
182
|
-
const expectedText = 'Password criteria has not been metPassword must contain at least 8 characters, at least one letter, and at least one number';
|
|
183
|
-
const newPasswordInput = resetPasswordPage.container.querySelector('input#newPassword');
|
|
184
|
-
newPasswordInput.value = 'test-password';
|
|
185
|
-
fireEvent.change(newPasswordInput);
|
|
186
|
-
|
|
187
|
-
fireEvent.blur(newPasswordInput);
|
|
188
|
-
|
|
189
|
-
const feedbackDiv = resetPasswordPage.container.querySelector('div[feedback-for="newPassword"]');
|
|
190
|
-
expect(feedbackDiv.textContent).toEqual(expectedText);
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
it('show spinner when api call is pending', () => {
|
|
194
|
-
store.dispatch = jest.fn(store.dispatch);
|
|
195
|
-
props = {
|
|
196
|
-
status:
|
|
197
|
-
TOKEN_STATE.PENDING,
|
|
198
|
-
};
|
|
199
|
-
useParams.mockReturnValue({ token });
|
|
200
|
-
|
|
201
|
-
render(reduxWrapper(<IntlResetPasswordPage {...props} />));
|
|
202
|
-
|
|
203
|
-
expect(store.dispatch).toHaveBeenCalledWith(validateToken(token));
|
|
204
|
-
|
|
205
|
-
useParams.mockClear();
|
|
206
|
-
});
|
|
207
|
-
it('should redirect the user to Reset password email screen ', async () => {
|
|
208
|
-
props = {
|
|
209
|
-
status:
|
|
210
|
-
PASSWORD_RESET_ERROR,
|
|
211
|
-
};
|
|
212
|
-
render(reduxWrapper(<IntlResetPasswordPage {...props} />));
|
|
213
|
-
expect(mockNavigate).toHaveBeenCalledWith(RESET_PAGE);
|
|
214
|
-
});
|
|
215
|
-
it('should redirect the user to root url of the application ', async () => {
|
|
216
|
-
props = {
|
|
217
|
-
status: SUCCESS,
|
|
218
|
-
};
|
|
219
|
-
render(reduxWrapper(<IntlResetPasswordPage {...props} />));
|
|
220
|
-
expect(mockNavigate).toHaveBeenCalledWith(LOGIN_PAGE);
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
it('shows spinner during token validation', () => {
|
|
224
|
-
render(reduxWrapper(<IntlResetPasswordPage {...props} />));
|
|
225
|
-
const spinnerElement = document.getElementsByClassName('div.spinner-header');
|
|
226
|
-
|
|
227
|
-
expect(spinnerElement).toBeTruthy();
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
// ******** redirection tests ********
|
|
231
|
-
|
|
232
|
-
it('by clicking on sign in tab should redirect onto login page', async () => {
|
|
233
|
-
const { getByText } = render(reduxWrapper(<IntlResetPasswordPage {...props} />));
|
|
234
|
-
|
|
235
|
-
const signInTab = getByText('Sign in');
|
|
236
|
-
|
|
237
|
-
fireEvent.click(signInTab);
|
|
238
|
-
|
|
239
|
-
expect(mockNavigate).toHaveBeenCalledWith(LOGIN_PAGE);
|
|
240
|
-
});
|
|
241
|
-
});
|