@openedx/frontend-app-authn 1.0.0-alpha.0 → 1.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Main.d.ts +3 -0
- package/dist/Main.js +10 -0
- 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/dist/common-components/EmbeddedRegistrationRoute.js +22 -0
- package/dist/common-components/EmbeddedRegistrationRoute.js.map +1 -0
- package/dist/common-components/EnterpriseSSO.d.ts +29 -0
- package/dist/common-components/EnterpriseSSO.js +58 -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 +47 -0
- package/dist/common-components/PasswordField.js +98 -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 +72 -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 +43 -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 +57 -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 +32 -0
- package/dist/common-components/UnAuthOnlyRoute.js.map +1 -0
- package/dist/common-components/components/ThirdPartyAuthContext.d.ts +31 -0
- package/dist/common-components/components/ThirdPartyAuthContext.js +84 -0
- package/dist/common-components/components/ThirdPartyAuthContext.js.map +1 -0
- package/dist/common-components/data/api.d.ts +6 -0
- package/dist/common-components/data/api.js +26 -0
- package/dist/common-components/data/api.js.map +1 -0
- package/dist/common-components/data/apiHook.d.ts +9 -0
- package/dist/common-components/data/apiHook.js +14 -0
- package/dist/common-components/data/apiHook.js.map +1 -0
- package/dist/common-components/data/queryKeys.d.ts +4 -0
- package/dist/common-components/data/queryKeys.js +6 -0
- package/dist/common-components/data/queryKeys.js.map +1 -0
- package/dist/common-components/index.d.ts +10 -0
- package/{src/common-components/index.jsx → dist/common-components/index.js} +1 -3
- 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 +14 -0
- package/dist/constants.js +17 -0
- package/dist/constants.js.map +1 -0
- package/dist/data/constants.d.ts +16 -0
- package/{src → dist}/data/constants.js +4 -17
- 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/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 +12 -0
- package/dist/data/utils/dataUtils.js +81 -0
- package/dist/data/utils/dataUtils.js.map +1 -0
- package/dist/data/utils/index.d.ts +2 -0
- package/dist/data/utils/index.js +3 -0
- package/dist/data/utils/index.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 +2 -0
- package/dist/forgot-password/ForgotPasswordPage.js +92 -0
- package/dist/forgot-password/ForgotPasswordPage.js.map +1 -0
- package/dist/forgot-password/data/api.d.ts +2 -0
- package/dist/forgot-password/data/api.js +25 -0
- package/dist/forgot-password/data/api.js.map +1 -0
- package/dist/forgot-password/data/apiHook.d.ts +16 -0
- package/dist/forgot-password/data/apiHook.js +26 -0
- package/dist/forgot-password/data/apiHook.js.map +1 -0
- package/dist/forgot-password/index.d.ts +1 -0
- package/dist/forgot-password/index.js +2 -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 +1 -0
- package/dist/i18n/index.js +2 -0
- package/dist/i18n/index.js.map +1 -0
- package/{src/index.ts → dist/index.d.ts} +0 -1
- package/dist/index.js +3 -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 +51 -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 +12 -0
- package/dist/login/LoginPage.js +174 -0
- package/dist/login/LoginPage.js.map +1 -0
- package/dist/login/components/LoginContext.d.ts +21 -0
- package/dist/login/components/LoginContext.js +28 -0
- package/dist/login/components/LoginContext.js.map +1 -0
- package/dist/login/data/api.d.ts +2 -0
- package/dist/login/data/api.js +27 -0
- package/dist/login/data/api.js.map +1 -0
- package/dist/login/data/apiHook.d.ts +13 -0
- package/dist/login/data/apiHook.js +57 -0
- package/dist/login/data/apiHook.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/index.d.ts +1 -0
- package/dist/login/index.js +2 -0
- 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 +5 -0
- package/dist/logistration/Logistration.js +80 -0
- package/dist/logistration/Logistration.js.map +1 -0
- package/dist/progressive-profiling/ProgressiveProfiling.d.ts +2 -0
- package/dist/progressive-profiling/ProgressiveProfiling.js +143 -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 +31 -0
- package/dist/progressive-profiling/ProgressiveProfilingPageModal.js.map +1 -0
- package/dist/progressive-profiling/components/ProgressiveProfilingContext.d.ts +18 -0
- package/dist/progressive-profiling/components/ProgressiveProfilingContext.js +52 -0
- package/dist/progressive-profiling/components/ProgressiveProfilingContext.js.map +1 -0
- package/dist/progressive-profiling/data/api.d.ts +2 -0
- package/dist/progressive-profiling/data/api.js +22 -0
- package/dist/progressive-profiling/data/api.js.map +1 -0
- package/dist/progressive-profiling/data/apiHook.d.ts +10 -0
- package/dist/progressive-profiling/data/apiHook.js +36 -0
- package/dist/progressive-profiling/data/apiHook.js.map +1 -0
- package/dist/progressive-profiling/index.d.ts +2 -0
- package/{src → dist}/progressive-profiling/index.js +1 -3
- 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/provides.d.ts +4 -0
- package/dist/provides.js +7 -0
- package/dist/provides.js.map +1 -0
- package/dist/register/RegistrationFields/CountryField/CountryField.d.ts +38 -0
- package/dist/register/RegistrationFields/CountryField/CountryField.js +93 -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 +88 -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 +59 -0
- package/dist/register/RegistrationFields/NameField/NameField.js.map +1 -0
- package/dist/register/RegistrationFields/NameField/validator.d.ts +6 -0
- package/dist/register/RegistrationFields/NameField/validator.js +23 -0
- 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 +119 -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 +259 -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/RegisterContext.d.ts +8 -0
- package/dist/register/components/RegisterContext.js +167 -0
- package/dist/register/components/RegisterContext.js.map +1 -0
- package/dist/register/components/RegistrationFailure.d.ts +19 -0
- package/dist/register/components/RegistrationFailure.js +60 -0
- package/dist/register/components/RegistrationFailure.js.map +1 -0
- package/dist/register/data/api.d.ts +9 -0
- package/dist/register/data/api.js +45 -0
- package/dist/register/data/api.js.map +1 -0
- package/dist/register/data/apiHook.d.ts +33 -0
- package/dist/register/data/apiHook.js +66 -0
- package/dist/register/data/apiHook.js.map +1 -0
- package/dist/register/data/constants.d.ts +11 -0
- package/{src → dist}/register/data/constants.js +5 -4
- package/dist/register/data/constants.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 +1 -0
- package/dist/register/index.js +2 -0
- package/dist/register/index.js.map +1 -0
- package/dist/register/messages.d.ts +203 -0
- package/dist/register/messages.js +215 -0
- package/dist/register/messages.js.map +1 -0
- package/dist/register/types.d.ts +74 -0
- package/dist/register/types.js +2 -0
- package/dist/register/types.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 +2 -0
- package/dist/reset-password/ResetPasswordPage.js +182 -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/api.d.ts +4 -0
- package/dist/reset-password/data/api.js +57 -0
- package/dist/reset-password/data/api.js.map +1 -0
- package/dist/reset-password/data/apiHook.d.ts +31 -0
- package/dist/reset-password/data/apiHook.js +74 -0
- package/dist/reset-password/data/apiHook.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/index.d.ts +1 -0
- package/dist/reset-password/index.js +2 -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 +19 -0
- package/dist/routes.js +76 -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 +15 -18
- package/{src → dist}/sass/_style.scss +40 -43
- package/dist/slots/LoginComponentSlot/index.d.ts +12 -0
- package/dist/slots/LoginComponentSlot/index.js +11 -0
- package/dist/slots/LoginComponentSlot/index.js.map +1 -0
- package/package.json +38 -16
- package/src/Main.tsx +0 -23
- 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/EmbeddedRegistrationRoute.jsx +0 -26
- 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/actions.js +0 -27
- 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/constants.ts +0 -1
- package/src/data/configureStore.js +0 -33
- package/src/data/oneTrust.js +0 -3
- package/src/data/reducers.js +0 -36
- package/src/data/sagas.js +0 -19
- 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/actions.js +0 -32
- 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/index.js +0 -5
- 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/actions.js +0 -39
- package/src/login/data/reducers.js +0 -76
- package/src/login/data/sagas.js +0 -45
- package/src/login/data/service.js +0 -24
- package/src/login/data/tests/reducers.test.js +0 -155
- package/src/login/data/tests/sagas.test.js +0 -110
- package/src/login/index.js +0 -5
- 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/actions.js +0 -22
- package/src/progressive-profiling/data/reducers.js +0 -38
- package/src/progressive-profiling/data/sagas.js +0 -24
- package/src/progressive-profiling/data/selectors.js +0 -14
- 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/NameField/validator.js +0 -22
- 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/actions.js +0 -85
- 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/index.js +0 -4
- 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/actions.js +0 -50
- 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/index.js +0 -5
- 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 → 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/forgot-password/index.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export { default as ForgotPasswordPage } from './ForgotPasswordPage';\n"]}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export default messages;
|
|
2
|
+
declare const messages: {
|
|
3
|
+
'forgot.password.page.title': {
|
|
4
|
+
id: string;
|
|
5
|
+
defaultMessage: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
'forgot.password.page.heading': {
|
|
9
|
+
id: string;
|
|
10
|
+
defaultMessage: string;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
'forgot.password.page.instructions': {
|
|
14
|
+
id: string;
|
|
15
|
+
defaultMessage: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
'forgot.password.page.invalid.email.message': {
|
|
19
|
+
id: string;
|
|
20
|
+
defaultMessage: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
'forgot.password.page.email.field.label': {
|
|
24
|
+
id: string;
|
|
25
|
+
defaultMessage: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
'forgot.password.page.submit.button': {
|
|
29
|
+
id: string;
|
|
30
|
+
defaultMessage: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
'forgot.password.error.alert.title': {
|
|
34
|
+
id: string;
|
|
35
|
+
defaultMessage: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
'forgot.password.error.message.title': {
|
|
39
|
+
id: string;
|
|
40
|
+
defaultMessage: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
'forgot.password.request.in.progress.message': {
|
|
44
|
+
id: string;
|
|
45
|
+
defaultMessage: string;
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
'forgot.password.empty.email.field.error': {
|
|
49
|
+
id: string;
|
|
50
|
+
defaultMessage: string;
|
|
51
|
+
description: string;
|
|
52
|
+
};
|
|
53
|
+
'forgot.password.email.help.text': {
|
|
54
|
+
id: string;
|
|
55
|
+
defaultMessage: string;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
'confirmation.message.title': {
|
|
59
|
+
id: string;
|
|
60
|
+
defaultMessage: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
'confirmation.support.link': {
|
|
64
|
+
id: string;
|
|
65
|
+
defaultMessage: string;
|
|
66
|
+
description: string;
|
|
67
|
+
};
|
|
68
|
+
'need.help.sign.in.text': {
|
|
69
|
+
id: string;
|
|
70
|
+
defaultMessage: string;
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
'additional.help.text': {
|
|
74
|
+
id: string;
|
|
75
|
+
defaultMessage: string;
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
'sign.in.text': {
|
|
79
|
+
id: string;
|
|
80
|
+
defaultMessage: string;
|
|
81
|
+
description: string;
|
|
82
|
+
};
|
|
83
|
+
'extend.field.errors': {
|
|
84
|
+
id: string;
|
|
85
|
+
defaultMessage: string;
|
|
86
|
+
description: string;
|
|
87
|
+
};
|
|
88
|
+
'invalid.token.heading': {
|
|
89
|
+
id: string;
|
|
90
|
+
defaultMessage: string;
|
|
91
|
+
description: string;
|
|
92
|
+
};
|
|
93
|
+
'invalid.token.error.message': {
|
|
94
|
+
id: string;
|
|
95
|
+
defaultMessage: string;
|
|
96
|
+
description: string;
|
|
97
|
+
};
|
|
98
|
+
'token.validation.rate.limit.error.heading': {
|
|
99
|
+
id: string;
|
|
100
|
+
defaultMessage: string;
|
|
101
|
+
description: string;
|
|
102
|
+
};
|
|
103
|
+
'token.validation.rate.limit.error': {
|
|
104
|
+
id: string;
|
|
105
|
+
defaultMessage: string;
|
|
106
|
+
description: string;
|
|
107
|
+
};
|
|
108
|
+
'token.validation.internal.sever.error.heading': {
|
|
109
|
+
id: string;
|
|
110
|
+
defaultMessage: string;
|
|
111
|
+
description: string;
|
|
112
|
+
};
|
|
113
|
+
'token.validation.internal.sever.error': {
|
|
114
|
+
id: string;
|
|
115
|
+
defaultMessage: string;
|
|
116
|
+
description: string;
|
|
117
|
+
};
|
|
118
|
+
'internal.server.error': {
|
|
119
|
+
id: string;
|
|
120
|
+
defaultMessage: string;
|
|
121
|
+
description: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
'forgot.password.page.title': {
|
|
4
|
+
id: 'forgot.password.page.title',
|
|
5
|
+
defaultMessage: 'Forgot Password | {siteName}',
|
|
6
|
+
description: 'forgot password page title',
|
|
7
|
+
},
|
|
8
|
+
'forgot.password.page.heading': {
|
|
9
|
+
id: 'forgot.password.page.heading',
|
|
10
|
+
defaultMessage: 'Reset password',
|
|
11
|
+
description: 'The page heading for the forgot password page.',
|
|
12
|
+
},
|
|
13
|
+
'forgot.password.page.instructions': {
|
|
14
|
+
id: 'forgot.password.page.instructions',
|
|
15
|
+
defaultMessage: 'Please enter your email address below and we will send you an email with instructions on how to reset your password.',
|
|
16
|
+
description: 'Instructions message for forgot password page.',
|
|
17
|
+
},
|
|
18
|
+
'forgot.password.page.invalid.email.message': {
|
|
19
|
+
id: 'forgot.password.page.invalid.email.message',
|
|
20
|
+
defaultMessage: 'Enter a valid email address',
|
|
21
|
+
description: 'Invalid email address message for input field.',
|
|
22
|
+
},
|
|
23
|
+
'forgot.password.page.email.field.label': {
|
|
24
|
+
id: 'forgot.password.page.email.field.label',
|
|
25
|
+
defaultMessage: 'Email',
|
|
26
|
+
description: 'Email field label for the forgot password page.',
|
|
27
|
+
},
|
|
28
|
+
'forgot.password.page.submit.button': {
|
|
29
|
+
id: 'forgot.password.page.submit.button',
|
|
30
|
+
defaultMessage: 'Submit',
|
|
31
|
+
description: 'Submit button text for the forgot password page.',
|
|
32
|
+
},
|
|
33
|
+
'forgot.password.error.alert.title': {
|
|
34
|
+
id: 'forgot.password.error.alert.title.',
|
|
35
|
+
defaultMessage: 'We were unable to contact you.',
|
|
36
|
+
description: 'Failed to send password recovery email.',
|
|
37
|
+
},
|
|
38
|
+
'forgot.password.error.message.title': {
|
|
39
|
+
id: 'forgot.password.error.message.title',
|
|
40
|
+
defaultMessage: 'An error occurred.',
|
|
41
|
+
description: 'Title for message that appears when error occurs for password assistance page',
|
|
42
|
+
},
|
|
43
|
+
'forgot.password.request.in.progress.message': {
|
|
44
|
+
id: 'forgot.password.request.in.progress.message',
|
|
45
|
+
defaultMessage: 'Your previous request is in progress, please try again in a few moments.',
|
|
46
|
+
description: 'Message displayed when previous password reset request is still in progress.',
|
|
47
|
+
},
|
|
48
|
+
'forgot.password.empty.email.field.error': {
|
|
49
|
+
id: 'forgot.password.empty.email.field.error',
|
|
50
|
+
defaultMessage: 'Enter your email',
|
|
51
|
+
description: 'Error message that appears when user tries to submit empty email field',
|
|
52
|
+
},
|
|
53
|
+
'forgot.password.email.help.text': {
|
|
54
|
+
id: 'forgot.password.email.help.text',
|
|
55
|
+
defaultMessage: 'The email address you used to register with {platformName}',
|
|
56
|
+
description: 'text help for the email',
|
|
57
|
+
},
|
|
58
|
+
// Confirmation Alert Message
|
|
59
|
+
'confirmation.message.title': {
|
|
60
|
+
id: 'confirmation.message.title',
|
|
61
|
+
defaultMessage: 'Check your email',
|
|
62
|
+
description: 'Forgot password confirmation message title',
|
|
63
|
+
},
|
|
64
|
+
'confirmation.support.link': {
|
|
65
|
+
id: 'confirmation.support.link',
|
|
66
|
+
defaultMessage: 'contact technical support',
|
|
67
|
+
description: 'Technical support link text',
|
|
68
|
+
},
|
|
69
|
+
'need.help.sign.in.text': {
|
|
70
|
+
id: 'need.help.sign.in.text',
|
|
71
|
+
defaultMessage: 'Need help signing in?',
|
|
72
|
+
description: 'Sign in help link on forgot password page',
|
|
73
|
+
},
|
|
74
|
+
'additional.help.text': {
|
|
75
|
+
id: 'additional.help.text',
|
|
76
|
+
defaultMessage: 'For additional help, contact {platformName} support at',
|
|
77
|
+
description: 'additional help text on forgot password page',
|
|
78
|
+
},
|
|
79
|
+
'sign.in.text': {
|
|
80
|
+
id: 'sign.in.text',
|
|
81
|
+
defaultMessage: 'Sign in',
|
|
82
|
+
description: 'login page link on password page',
|
|
83
|
+
},
|
|
84
|
+
'extend.field.errors': {
|
|
85
|
+
id: 'extend.field.errors',
|
|
86
|
+
defaultMessage: '{emailError} below.',
|
|
87
|
+
description: 'extends the field error for alert message',
|
|
88
|
+
},
|
|
89
|
+
// Reset password token validation failure
|
|
90
|
+
'invalid.token.heading': {
|
|
91
|
+
id: 'invalid.token.heading',
|
|
92
|
+
defaultMessage: 'Invalid password reset link',
|
|
93
|
+
description: 'Alert heading when reset password link is invalid',
|
|
94
|
+
},
|
|
95
|
+
'invalid.token.error.message': {
|
|
96
|
+
id: 'invalid.token.error.message',
|
|
97
|
+
defaultMessage: 'This password reset link is invalid. It may have been used already. Enter your email below to receive a new link.',
|
|
98
|
+
description: 'Alert message when reset password link has expired or is invalid',
|
|
99
|
+
},
|
|
100
|
+
'token.validation.rate.limit.error.heading': {
|
|
101
|
+
id: 'token.validation.rate.limit.error.heading',
|
|
102
|
+
defaultMessage: 'Too many requests',
|
|
103
|
+
description: 'Too many request at server end point',
|
|
104
|
+
},
|
|
105
|
+
'token.validation.rate.limit.error': {
|
|
106
|
+
id: 'token.validation.rate.limit.error',
|
|
107
|
+
defaultMessage: 'An error has occurred because of too many requests. Please try again after some time.',
|
|
108
|
+
description: 'Error message that appears when server responds with 429 error code',
|
|
109
|
+
},
|
|
110
|
+
'token.validation.internal.sever.error.heading': {
|
|
111
|
+
id: 'token.validation.internal.sever.error.heading',
|
|
112
|
+
defaultMessage: 'Token validation failure',
|
|
113
|
+
description: 'Failed to validate reset password token error message.',
|
|
114
|
+
},
|
|
115
|
+
'token.validation.internal.sever.error': {
|
|
116
|
+
id: 'token.validation.internal.sever.error',
|
|
117
|
+
defaultMessage: 'An error has occurred. Try refreshing the page, or check your internet connection.',
|
|
118
|
+
description: 'Error message that appears when server responds with 500 error code',
|
|
119
|
+
},
|
|
120
|
+
// Error messages
|
|
121
|
+
'internal.server.error': {
|
|
122
|
+
id: 'internal.server.error',
|
|
123
|
+
defaultMessage: 'An error has occurred. Try refreshing the page, or check your internet connection.',
|
|
124
|
+
description: 'Error message that appears when server responds with 500 error code',
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
export default messages;
|
|
128
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/forgot-password/messages.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,4BAA4B,EAAE;QAC5B,EAAE,EAAE,4BAA4B;QAChC,cAAc,EAAE,8BAA8B;QAC9C,WAAW,EAAE,4BAA4B;KAC1C;IACD,8BAA8B,EAAE;QAC9B,EAAE,EAAE,8BAA8B;QAClC,cAAc,EAAE,gBAAgB;QAChC,WAAW,EAAE,gDAAgD;KAC9D;IACD,mCAAmC,EAAE;QACnC,EAAE,EAAE,mCAAmC;QACvC,cAAc,EAAE,sHAAsH;QACtI,WAAW,EAAE,gDAAgD;KAC9D;IACD,4CAA4C,EAAE;QAC5C,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,6BAA6B;QAC7C,WAAW,EAAE,gDAAgD;KAC9D;IACD,wCAAwC,EAAE;QACxC,EAAE,EAAE,wCAAwC;QAC5C,cAAc,EAAE,OAAO;QACvB,WAAW,EAAE,iDAAiD;KAC/D;IACD,oCA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BAAqB;QACrC,WAAW,EAAE,2CAA2C;KACzD;IACD,0CAA0C;IAC1C,uBAAuB,EAAE;QACvB,EAAE,EAAE,uBAAuB;QAC3B,cAAc,EAAE,6BAA6B;QAC7C,WAAW,EAAE,mDAAmD;KACjE;IACD,6BAA6B,EAAE;QAC7B,EAAE,EAAE,6BAA6B;QACjC,cAAc,EAAE,mHAAmH;QACnI,WAAW,EAAE,kEAAkE;KAChF;IACD,2CAA2C,EAAE;QAC3C,EAAE,EAAE,2CAA2C;QAC/C,cAAc,EAAE,mBAAmB;QACnC,WAAW,EAAE,sCAAsC;KACpD;IACD,mCAAmC,EAAE;QACnC,EAAE,EAAE,mCAAmC;QACvC,cAAc,EAAE,uFAAuF;QACvG,WAAW,EAAE,qEAAqE;KACnF;IACD,+CAA+C,EAAE;QAC/C,EAAE,EAAE,+CAA+C;QACnD,cAAc,EAAE,0BAA0B;QAC1C,WAAW,EAAE,wDAAwD;KACtE;IACD,uCAAuC,EAAE;QACvC,EAAE,EAAE,uCAAuC;QAC3C,cAAc,EAAE,oFAAoF;QACpG,WAAW,EAAE,qEAAqE;KACnF;IACD,iBAAiB;IACjB,uBAAuB,EAAE;QACvB,EAAE,EAAE,uBAAuB;QAC3B,cAAc,EAAE,oFAAoF;QACpG,WAAW,EAAE,qEAAqE;KACnF;CACF,CAAC,CAAC;AACH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n 'forgot.password.page.title': {\n id: 'forgot.password.page.title',\n defaultMessage: 'Forgot Password | {siteName}',\n description: 'forgot password page title',\n },\n 'forgot.password.page.heading': {\n id: 'forgot.password.page.heading',\n defaultMessage: 'Reset password',\n description: 'The page heading for the forgot password page.',\n },\n 'forgot.password.page.instructions': {\n id: 'forgot.password.page.instructions',\n defaultMessage: 'Please enter your email address below and we will send you an email with instructions on how to reset your password.',\n description: 'Instructions message for forgot password page.',\n },\n 'forgot.password.page.invalid.email.message': {\n id: 'forgot.password.page.invalid.email.message',\n defaultMessage: 'Enter a valid email address',\n description: 'Invalid email address message for input field.',\n },\n 'forgot.password.page.email.field.label': {\n id: 'forgot.password.page.email.field.label',\n defaultMessage: 'Email',\n description: 'Email field label for the forgot password page.',\n },\n 'forgot.password.page.submit.button': {\n id: 'forgot.password.page.submit.button',\n defaultMessage: 'Submit',\n description: 'Submit button text for the forgot password page.',\n },\n 'forgot.password.error.alert.title': {\n id: 'forgot.password.error.alert.title.',\n defaultMessage: 'We were unable to contact you.',\n description: 'Failed to send password recovery email.',\n },\n 'forgot.password.error.message.title': {\n id: 'forgot.password.error.message.title',\n defaultMessage: 'An error occurred.',\n description: 'Title for message that appears when error occurs for password assistance page',\n },\n 'forgot.password.request.in.progress.message': {\n id: 'forgot.password.request.in.progress.message',\n defaultMessage: 'Your previous request is in progress, please try again in a few moments.',\n description: 'Message displayed when previous password reset request is still in progress.',\n },\n 'forgot.password.empty.email.field.error': {\n id: 'forgot.password.empty.email.field.error',\n defaultMessage: 'Enter your email',\n description: 'Error message that appears when user tries to submit empty email field',\n },\n 'forgot.password.email.help.text': {\n id: 'forgot.password.email.help.text',\n defaultMessage: 'The email address you used to register with {platformName}',\n description: 'text help for the email',\n },\n // Confirmation Alert Message\n 'confirmation.message.title': {\n id: 'confirmation.message.title',\n defaultMessage: 'Check your email',\n description: 'Forgot password confirmation message title',\n },\n 'confirmation.support.link': {\n id: 'confirmation.support.link',\n defaultMessage: 'contact technical support',\n description: 'Technical support link text',\n },\n 'need.help.sign.in.text': {\n id: 'need.help.sign.in.text',\n defaultMessage: 'Need help signing in?',\n description: 'Sign in help link on forgot password page',\n },\n 'additional.help.text': {\n id: 'additional.help.text',\n defaultMessage: 'For additional help, contact {platformName} support at',\n description: 'additional help text on forgot password page',\n },\n 'sign.in.text': {\n id: 'sign.in.text',\n defaultMessage: 'Sign in',\n description: 'login page link on password page',\n },\n 'extend.field.errors': {\n id: 'extend.field.errors',\n defaultMessage: '{emailError} below.',\n description: 'extends the field error for alert message',\n },\n // Reset password token validation failure\n 'invalid.token.heading': {\n id: 'invalid.token.heading',\n defaultMessage: 'Invalid password reset link',\n description: 'Alert heading when reset password link is invalid',\n },\n 'invalid.token.error.message': {\n id: 'invalid.token.error.message',\n defaultMessage: 'This password reset link is invalid. It may have been used already. Enter your email below to receive a new link.',\n description: 'Alert message when reset password link has expired or is invalid',\n },\n 'token.validation.rate.limit.error.heading': {\n id: 'token.validation.rate.limit.error.heading',\n defaultMessage: 'Too many requests',\n description: 'Too many request at server end point',\n },\n 'token.validation.rate.limit.error': {\n id: 'token.validation.rate.limit.error',\n defaultMessage: 'An error has occurred because of too many requests. Please try again after some time.',\n description: 'Error message that appears when server responds with 429 error code',\n },\n 'token.validation.internal.sever.error.heading': {\n id: 'token.validation.internal.sever.error.heading',\n defaultMessage: 'Token validation failure',\n description: 'Failed to validate reset password token error message.',\n },\n 'token.validation.internal.sever.error': {\n id: 'token.validation.internal.sever.error',\n defaultMessage: 'An error has occurred. Try refreshing the page, or check your internet connection.',\n description: 'Error message that appears when server responds with 500 error code',\n },\n // Error messages\n 'internal.server.error': {\n id: 'internal.server.error',\n defaultMessage: 'An error has occurred. Try refreshing the page, or check your internet connection.',\n description: 'Error message that appears when server responds with 500 error code',\n },\n});\nexport default messages;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './messages';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { default } from './messages';\n"]}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { default as authnApp } from './app';\nexport { default as authnRoutes } from './routes';\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default AccountActivationMessage;
|
|
2
|
+
declare function AccountActivationMessage({ messageType }: {
|
|
3
|
+
messageType: any;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
5
|
+
declare namespace AccountActivationMessage {
|
|
6
|
+
namespace propTypes {
|
|
7
|
+
let messageType: PropTypes.Requireable<string>;
|
|
8
|
+
}
|
|
9
|
+
namespace defaultProps {
|
|
10
|
+
let messageType_1: null;
|
|
11
|
+
export { messageType_1 as messageType };
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FormattedMessage, useAppConfig, useIntl } from '@openedx/frontend-base';
|
|
3
|
+
import { Alert } from '@openedx/paragon';
|
|
4
|
+
import { CheckCircle, Error } from '@openedx/paragon/icons';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { ACCOUNT_ACTIVATION_MESSAGE } from './data/constants';
|
|
7
|
+
import messages from './messages';
|
|
8
|
+
const AccountActivationMessage = ({ messageType }) => {
|
|
9
|
+
const { formatMessage } = useIntl();
|
|
10
|
+
if (!messageType) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const variant = messageType === ACCOUNT_ACTIVATION_MESSAGE.ERROR ? 'danger' : messageType;
|
|
14
|
+
const activationOrConfirmation = useAppConfig().MARKETING_EMAILS_OPT_IN ? 'confirmation' : 'activation';
|
|
15
|
+
const iconMapping = {
|
|
16
|
+
[ACCOUNT_ACTIVATION_MESSAGE.SUCCESS]: CheckCircle,
|
|
17
|
+
[ACCOUNT_ACTIVATION_MESSAGE.ERROR]: Error,
|
|
18
|
+
};
|
|
19
|
+
let activationMessage;
|
|
20
|
+
let heading;
|
|
21
|
+
switch (messageType) {
|
|
22
|
+
case ACCOUNT_ACTIVATION_MESSAGE.SUCCESS: {
|
|
23
|
+
heading = formatMessage(messages[`account.${activationOrConfirmation}.success.message.title`]);
|
|
24
|
+
activationMessage = _jsx("span", { children: formatMessage(messages[`account.${activationOrConfirmation}.success.message`]) });
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
case ACCOUNT_ACTIVATION_MESSAGE.INFO: {
|
|
28
|
+
activationMessage = formatMessage(messages[`account.${activationOrConfirmation}.info.message`]);
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
case ACCOUNT_ACTIVATION_MESSAGE.ERROR: {
|
|
32
|
+
const supportLink = (_jsx(Alert.Link, { href: useAppConfig().ACTIVATION_EMAIL_SUPPORT_LINK, children: formatMessage(messages['account.activation.support.link']) }));
|
|
33
|
+
heading = formatMessage(messages[`account.${activationOrConfirmation}.error.message.title`]);
|
|
34
|
+
activationMessage = (_jsx(FormattedMessage, { id: "account.activation.error.message", defaultMessage: "Something went wrong, please {supportLink} to resolve this issue.", description: "Account activation error message", values: { supportLink } }));
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
default:
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
return activationMessage ? (_jsxs(Alert, { id: "account-activation-message", className: "mb-5", variant: variant, icon: iconMapping[messageType], children: [heading && _jsx(Alert.Heading, { children: heading }), activationMessage] })) : null;
|
|
41
|
+
};
|
|
42
|
+
AccountActivationMessage.propTypes = {
|
|
43
|
+
messageType: PropTypes.string,
|
|
44
|
+
};
|
|
45
|
+
AccountActivationMessage.defaultProps = {
|
|
46
|
+
messageType: null,
|
|
47
|
+
};
|
|
48
|
+
export default AccountActivationMessage;
|
|
49
|
+
//# sourceMappingURL=AccountActivationMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountActivationMessage.js","sourceRoot":"","sources":["../../src/login/AccountActivationMessage.jsx"],"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BAA0B,CAAC,IAAI,CAAC,CAAC,CAAC;YACrC,iBAAiB,GAAG,aAAa,CAAC,QAAQ,CAAC,WAAW,wBAAwB,eAAe,CAAC,CAAC,CAAC;YAChG,MAAM;QACR,CAAC;QACD,KAAK,0BAA0B,CAAC,KAAK,CAAC,CAAC,CAAC;YACtC,MAAM,WAAW,GAAG,CAClB,KAAC,KAAK,CAAC,IAAI,IAAC,IAAI,EAAE,YAAY,EAAE,CAAC,6BAA6B,YAC3D,aAAa,CAAC,QAAQ,CAAC,iCAAiC,CAAC,CAAC,GAChD,CACd,CAAC;YAEF,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,WAAW,wBAAwB,sBAAsB,CAAC,CAAC,CAAC;YAC7F,iBAAiB,GAAG,CAClB,KAAC,gBAAgB,IACf,EAAE,EAAC,kCAAkC,EACrC,cAAc,EAAC,mEAAmE,EAClF,WAAW,EAAC,kCAAkC,EAC9C,MAAM,EAAE,EAAE,WAAW,EAAE,GACvB,CACH,CAAC;YACF,MAAM;QACR,CAAC;QACD;YACE,MAAM;IACV,CAAC;IAED,OAAO,iBAAiB,CAAC,CAAC,CAAC,CACzB,MAAC,KAAK,IACJ,EAAE,EAAC,4BAA4B,EAC/B,SAAS,EAAC,MAAM,EAChB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,CAAC,WAAW,CAAC,aAE7B,OAAO,IAAI,KAAC,KAAK,CAAC,OAAO,cAAE,OAAO,GAAiB,EACnD,iBAAiB,IACZ,CACT,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CAAC;AAEF,wBAAwB,CAAC,SAAS,GAAG;IACnC,WAAW,EAAE,SAAS,CAAC,MAAM;CAC9B,CAAC;AAEF,wBAAwB,CAAC,YAAY,GAAG;IACtC,WAAW,EAAE,IAAI;CAClB,CAAC;AAEF,eAAe,wBAAwB,CAAC","sourcesContent":["import { FormattedMessage, useAppConfig, useIntl } from '@openedx/frontend-base';\nimport { Alert } from '@openedx/paragon';\nimport { CheckCircle, Error } from '@openedx/paragon/icons';\nimport PropTypes from 'prop-types';\n\nimport { ACCOUNT_ACTIVATION_MESSAGE } from './data/constants';\nimport messages from './messages';\n\nconst AccountActivationMessage = ({ messageType }) => {\n const { formatMessage } = useIntl();\n\n if (!messageType) {\n return null;\n }\n\n const variant = messageType === ACCOUNT_ACTIVATION_MESSAGE.ERROR ? 'danger' : messageType;\n const activationOrConfirmation = useAppConfig().MARKETING_EMAILS_OPT_IN ? 'confirmation' : 'activation';\n const iconMapping = {\n [ACCOUNT_ACTIVATION_MESSAGE.SUCCESS]: CheckCircle,\n [ACCOUNT_ACTIVATION_MESSAGE.ERROR]: Error,\n };\n\n let activationMessage;\n let heading;\n switch (messageType) {\n case ACCOUNT_ACTIVATION_MESSAGE.SUCCESS: {\n heading = formatMessage(messages[`account.${activationOrConfirmation}.success.message.title`]);\n activationMessage = <span>{formatMessage(messages[`account.${activationOrConfirmation}.success.message`])}</span>;\n break;\n }\n case ACCOUNT_ACTIVATION_MESSAGE.INFO: {\n activationMessage = formatMessage(messages[`account.${activationOrConfirmation}.info.message`]);\n break;\n }\n case ACCOUNT_ACTIVATION_MESSAGE.ERROR: {\n const supportLink = (\n <Alert.Link href={useAppConfig().ACTIVATION_EMAIL_SUPPORT_LINK}>\n {formatMessage(messages['account.activation.support.link'])}\n </Alert.Link>\n );\n\n heading = formatMessage(messages[`account.${activationOrConfirmation}.error.message.title`]);\n activationMessage = (\n <FormattedMessage\n id=\"account.activation.error.message\"\n defaultMessage=\"Something went wrong, please {supportLink} to resolve this issue.\"\n description=\"Account activation error message\"\n values={{ supportLink }}\n />\n );\n break;\n }\n default:\n break;\n }\n\n return activationMessage ? (\n <Alert\n id=\"account-activation-message\"\n className=\"mb-5\"\n variant={variant}\n icon={iconMapping[messageType]}\n >\n {heading && <Alert.Heading>{heading}</Alert.Heading>}\n {activationMessage}\n </Alert>\n ) : null;\n};\n\nAccountActivationMessage.propTypes = {\n messageType: PropTypes.string,\n};\n\nAccountActivationMessage.defaultProps = {\n messageType: null,\n};\n\nexport default AccountActivationMessage;\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export default ChangePasswordPrompt;
|
|
2
|
+
declare function ChangePasswordPrompt({ variant, redirectUrl }: {
|
|
3
|
+
variant: any;
|
|
4
|
+
redirectUrl: any;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare namespace ChangePasswordPrompt {
|
|
7
|
+
namespace defaultProps {
|
|
8
|
+
let variant: string;
|
|
9
|
+
let redirectUrl: null;
|
|
10
|
+
}
|
|
11
|
+
namespace propTypes {
|
|
12
|
+
let variant_1: PropTypes.Requireable<string>;
|
|
13
|
+
export { variant_1 as variant };
|
|
14
|
+
let redirectUrl_1: PropTypes.Requireable<string>;
|
|
15
|
+
export { redirectUrl_1 as redirectUrl };
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { getUrlByRouteRole, useIntl } from '@openedx/frontend-base';
|
|
4
|
+
import { ActionRow, ModalDialog, useToggle, } from '@openedx/paragon';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { Link, useNavigate } from 'react-router-dom';
|
|
8
|
+
import { dashboardRole, resetPasswordRole } from '../constants';
|
|
9
|
+
import { updatePathWithQueryParams } from '../data/utils';
|
|
10
|
+
import useMobileResponsive from '../data/utils/useMobileResponsive';
|
|
11
|
+
import messages from './messages';
|
|
12
|
+
const ChangePasswordPrompt = ({ variant, redirectUrl }) => {
|
|
13
|
+
const isMobileView = useMobileResponsive();
|
|
14
|
+
const [redirectToResetPasswordPage, setRedirectToResetPasswordPage] = useState(false);
|
|
15
|
+
const handlers = {
|
|
16
|
+
handleToggleOff: () => {
|
|
17
|
+
if (variant === 'block') {
|
|
18
|
+
setRedirectToResetPasswordPage(true);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const url = redirectUrl || getUrlByRouteRole(dashboardRole) || '/';
|
|
22
|
+
if (url.startsWith('/')) {
|
|
23
|
+
navigate(url);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
window.location.href = url;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
32
|
+
const [isOpen, open, close] = useToggle(true, handlers);
|
|
33
|
+
const { formatMessage } = useIntl();
|
|
34
|
+
const navigate = useNavigate();
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (redirectToResetPasswordPage) {
|
|
37
|
+
navigate(updatePathWithQueryParams(getUrlByRouteRole(resetPasswordRole)));
|
|
38
|
+
}
|
|
39
|
+
}, [redirectToResetPasswordPage, navigate]);
|
|
40
|
+
return (_jsxs(ModalDialog, { title: "Password security", isOpen: isOpen, onClose: close, size: isMobileView ? 'sm' : 'md', hasCloseButton: false, children: [_jsx(ModalDialog.Header, { children: _jsx(ModalDialog.Title, { children: formatMessage(messages[`password.security.${variant}.title`]) }) }), _jsx(ModalDialog.Body, { children: formatMessage(messages[`password.security.${variant}.body`]) }), _jsx(ModalDialog.Footer, { children: _jsxs(ActionRow, { className: classNames({ 'd-flex flex-column': isMobileView }), children: [variant === 'nudge' ? (_jsx(ModalDialog.CloseButton, { id: "password-security-close", variant: "tertiary", children: formatMessage(messages['password.security.close.button']) })) : null, _jsx(Link, { id: "password-security-reset-password", className: classNames('btn btn-primary', { 'w-100': isMobileView }), to: updatePathWithQueryParams(getUrlByRouteRole(resetPasswordRole)), children: formatMessage(messages['password.security.redirect.to.reset.password.button']) })] }) })] }));
|
|
41
|
+
};
|
|
42
|
+
ChangePasswordPrompt.defaultProps = {
|
|
43
|
+
variant: 'block',
|
|
44
|
+
redirectUrl: null,
|
|
45
|
+
};
|
|
46
|
+
ChangePasswordPrompt.propTypes = {
|
|
47
|
+
variant: PropTypes.oneOf(['nudge', 'block']),
|
|
48
|
+
redirectUrl: PropTypes.string,
|
|
49
|
+
};
|
|
50
|
+
export default ChangePasswordPrompt;
|
|
51
|
+
//# sourceMappingURL=ChangePasswordPrompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChangePasswordPrompt.js","sourceRoot":"","sources":["../../src/login/ChangePasswordPrompt.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EACL,SAAS,EAAE,WAAW,EAAE,SAAS,GAClC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,mBAAmB,MAAM,mCAAmC,CAAC;AACpE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,oBAAoB,GAAG,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE;IACxD,MAAM,YAAY,GAAG,mBAAmB,EAAE,CAAC;IAC3C,MAAM,CAAC,2BAA2B,EAAE,8BAA8B,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtF,MAAM,QAAQ,GAAG;QACf,eAAe,EAAE,GAAG,EAAE;YACpB,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;gBACxB,8BAA8B,CAAC,IAAI,CAAC,CAAC;YACvC,CAAC;iBAAM,CAAC;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AAS,EAAE,UAAU,CAC9B,EAAE,oBAAoB,EAAE,YAAY,EAAE,CACvC,aAEE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,CACrB,KAAC,WAAW,CAAC,WAAW,IAAC,EAAE,EAAC,yBAAyB,EAAC,OAAO,EAAC,UAAU,YACrE,aAAa,CAAC,QAAQ,CAAC,gCAAgC,CAAC,CAAC,GAClC,CAC3B,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,IAAI,IACH,EAAE,EAAC,kCAAkC,EACrC,SAAS,EAAE,UAAU,CACnB,iBAAiB,EACjB,EAAE,OAAO,EAAE,YAAY,EAAE,CAC1B,EACD,EAAE,EAAE,yBAAyB,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,YAElE,aAAa,CAAC,QAAQ,CAAC,qDAAqD,CAAC,CAAC,GAC1E,IACG,GACO,IACT,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,oBAAoB,CAAC,YAAY,GAAG;IAClC,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,IAAI;CAClB,CAAC;AAEF,oBAAoB,CAAC,SAAS,GAAG;IAC/B,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5C,WAAW,EAAE,SAAS,CAAC,MAAM;CAC9B,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { getUrlByRouteRole, useIntl } from '@openedx/frontend-base';\nimport {\n ActionRow, ModalDialog, useToggle,\n} from '@openedx/paragon';\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport { Link, useNavigate } from 'react-router-dom';\n\nimport { dashboardRole, resetPasswordRole } from '../constants';\nimport { updatePathWithQueryParams } from '../data/utils';\nimport useMobileResponsive from '../data/utils/useMobileResponsive';\nimport messages from './messages';\n\nconst ChangePasswordPrompt = ({ variant, redirectUrl }) => {\n const isMobileView = useMobileResponsive();\n const [redirectToResetPasswordPage, setRedirectToResetPasswordPage] = useState(false);\n const handlers = {\n handleToggleOff: () => {\n if (variant === 'block') {\n setRedirectToResetPasswordPage(true);\n } else {\n const url = redirectUrl || getUrlByRouteRole(dashboardRole) || '/';\n if (url.startsWith('/')) {\n navigate(url);\n } else {\n window.location.href = url;\n }\n }\n },\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [isOpen, open, close] = useToggle(true, handlers);\n const { formatMessage } = useIntl();\n const navigate = useNavigate();\n\n useEffect(() => {\n if (redirectToResetPasswordPage) {\n navigate(updatePathWithQueryParams(getUrlByRouteRole(resetPasswordRole)));\n }\n }, [redirectToResetPasswordPage, navigate]);\n\n return (\n <ModalDialog\n title=\"Password security\"\n isOpen={isOpen}\n onClose={close}\n size={isMobileView ? 'sm' : 'md'}\n hasCloseButton={false}\n >\n <ModalDialog.Header>\n <ModalDialog.Title>\n {formatMessage(messages[`password.security.${variant}.title`])}\n </ModalDialog.Title>\n </ModalDialog.Header>\n <ModalDialog.Body>\n {formatMessage(messages[`password.security.${variant}.body`])}\n </ModalDialog.Body>\n <ModalDialog.Footer>\n <ActionRow className={classNames(\n { 'd-flex flex-column': isMobileView },\n )}\n >\n {variant === 'nudge' ? (\n <ModalDialog.CloseButton id=\"password-security-close\" variant=\"tertiary\">\n {formatMessage(messages['password.security.close.button'])}\n </ModalDialog.CloseButton>\n ) : null}\n <Link\n id=\"password-security-reset-password\"\n className={classNames(\n 'btn btn-primary',\n { 'w-100': isMobileView },\n )}\n to={updatePathWithQueryParams(getUrlByRouteRole(resetPasswordRole))}\n >\n {formatMessage(messages['password.security.redirect.to.reset.password.button'])}\n </Link>\n </ActionRow>\n </ModalDialog.Footer>\n </ModalDialog>\n );\n};\n\nChangePasswordPrompt.defaultProps = {\n variant: 'block',\n redirectUrl: null,\n};\n\nChangePasswordPrompt.propTypes = {\n variant: PropTypes.oneOf(['nudge', 'block']),\n redirectUrl: PropTypes.string,\n};\n\nexport default ChangePasswordPrompt;\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default LoginFailureMessage;
|
|
2
|
+
declare function LoginFailureMessage(props: any): import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
declare namespace LoginFailureMessage {
|
|
4
|
+
namespace defaultProps {
|
|
5
|
+
let context: {};
|
|
6
|
+
}
|
|
7
|
+
namespace propTypes {
|
|
8
|
+
let context_1: PropTypes.Requireable<PropTypes.InferProps<{
|
|
9
|
+
supportLink: PropTypes.Requireable<string>;
|
|
10
|
+
platformName: PropTypes.Requireable<string>;
|
|
11
|
+
tpaHint: PropTypes.Requireable<string>;
|
|
12
|
+
provider: PropTypes.Requireable<string>;
|
|
13
|
+
allowedDomain: PropTypes.Requireable<string>;
|
|
14
|
+
remainingAttempts: PropTypes.Requireable<number>;
|
|
15
|
+
failureCount: PropTypes.Requireable<number>;
|
|
16
|
+
errorMessage: PropTypes.Requireable<string>;
|
|
17
|
+
email: PropTypes.Requireable<string>;
|
|
18
|
+
redirectUrl: PropTypes.Requireable<string>;
|
|
19
|
+
}>>;
|
|
20
|
+
export { context_1 as context };
|
|
21
|
+
export let errorCode: PropTypes.Validator<string>;
|
|
22
|
+
export let errorCount: PropTypes.Validator<number>;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
import PropTypes from 'prop-types';
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { FormattedMessage, getAuthService, getSiteConfig, useIntl } from '@openedx/frontend-base';
|
|
4
|
+
import { Alert, Hyperlink } from '@openedx/paragon';
|
|
5
|
+
import { Error } from '@openedx/paragon/icons';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { windowScrollTo } from '../data/utils';
|
|
8
|
+
import ChangePasswordPrompt from './ChangePasswordPrompt';
|
|
9
|
+
import { ACCOUNT_LOCKED_OUT, ALLOWED_DOMAIN_LOGIN_ERROR, FAILED_LOGIN_ATTEMPT, FORBIDDEN_REQUEST, INACTIVE_USER, INCORRECT_EMAIL_PASSWORD, INTERNAL_SERVER_ERROR, INVALID_FORM, NON_COMPLIANT_PASSWORD_EXCEPTION, NUDGE_PASSWORD_CHANGE, REQUIRE_PASSWORD_CHANGE, TPA_AUTHENTICATION_FAILURE, } from './data/constants';
|
|
10
|
+
import messages from './messages';
|
|
11
|
+
const LoginFailureMessage = (props) => {
|
|
12
|
+
const { formatMessage } = useIntl();
|
|
13
|
+
const authService = getAuthService();
|
|
14
|
+
const { context, errorCode, errorCount, // This is used to trigger the useEffect, facilitating the scrolling to the top.
|
|
15
|
+
} = props;
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
windowScrollTo({ left: 0, top: 0, behavior: 'smooth' });
|
|
18
|
+
}, [errorCode, errorCount]);
|
|
19
|
+
if (!errorCode) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
let resetLink = (_jsx(Hyperlink, { destination: "reset", isInline: true, children: formatMessage(messages['login.incorrect.credentials.error.reset.link.text']) }));
|
|
23
|
+
let errorMessage;
|
|
24
|
+
switch (errorCode) {
|
|
25
|
+
case NON_COMPLIANT_PASSWORD_EXCEPTION: {
|
|
26
|
+
errorMessage = (_jsxs(_Fragment, { children: [_jsx("strong", { children: formatMessage(messages['non.compliant.password.title']) }), _jsx("p", { children: formatMessage(messages['non.compliant.password.message']) })] }));
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
case FORBIDDEN_REQUEST:
|
|
30
|
+
errorMessage = _jsx("p", { children: formatMessage(messages['login.rate.limit.reached.message']) });
|
|
31
|
+
break;
|
|
32
|
+
case INACTIVE_USER: {
|
|
33
|
+
const supportLink = (_jsx("a", { href: context.supportLink, children: formatMessage(messages['contact.support.link'], { platformName: context.platformName }) }));
|
|
34
|
+
errorMessage = (_jsx("p", { children: _jsx(FormattedMessage, { id: "login.inactive.user.error", defaultMessage: "In order to sign in, you need to activate your account.{lineBreak}\n {lineBreak}We just sent an activation link to {email}. If you do not receive an email,\n check your spam folders or {supportLink}.", description: "An error message shown to users when they sign in if they have not yet activated their account. It attempts to explain to them how to activate their account by looking for an email from the system.", values: {
|
|
35
|
+
lineBreak: _jsx("br", {}),
|
|
36
|
+
email: _jsx("strong", { className: "data-hj-suppress", children: context.email }),
|
|
37
|
+
supportLink,
|
|
38
|
+
} }) }));
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
case ALLOWED_DOMAIN_LOGIN_ERROR: {
|
|
42
|
+
const url = `${getSiteConfig().lmsBaseUrl}/dashboard/?tpa_hint=${context.tpaHint}`;
|
|
43
|
+
const tpaLink = (_jsx("a", { href: url, children: formatMessage(messages['tpa.account.link'], { provider: context.provider }) }));
|
|
44
|
+
errorMessage = (_jsx("p", { children: _jsx(FormattedMessage, { id: "allowed.domain.login.error", description: "Display this error message when staff user try to login through password", defaultMessage: "As {allowedDomain} user, You must login with your {allowedDomain} {tpaLink}.", values: { allowedDomain: context.allowedDomain, tpaLink } }) }));
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
case INVALID_FORM:
|
|
48
|
+
errorMessage = _jsx("p", { children: formatMessage(messages['login.form.invalid.error.message']) });
|
|
49
|
+
break;
|
|
50
|
+
case FAILED_LOGIN_ATTEMPT: {
|
|
51
|
+
resetLink = (_jsx(Hyperlink, { destination: "reset", isInline: true, children: formatMessage(messages['login.incorrect.credentials.error.before.account.blocked.text']) }));
|
|
52
|
+
errorMessage = (_jsxs(_Fragment, { children: [_jsx("p", { children: _jsx(FormattedMessage, { id: "login.incorrect.credentials.error.attempts.text.1", description: "Error message for incorrect email or password", defaultMessage: "The username, email or password you entered is incorrect. You have {remainingAttempts} more sign in\n attempts before your account is temporarily locked.", values: { remainingAttempts: context.remainingAttempts } }) }), _jsx("p", { children: _jsx(FormattedMessage, { id: "login.incorrect.credentials.error.attempts.text.2", description: "Part of error message for incorrect email or password", defaultMessage: "If you've forgotten your password, {resetLink}", values: { resetLink } }) })] }));
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
case ACCOUNT_LOCKED_OUT: {
|
|
56
|
+
errorMessage = (_jsxs(_Fragment, { children: [_jsx("p", { children: formatMessage(messages['account.locked.out.message.1']) }), _jsx("p", { children: _jsx(FormattedMessage, { id: "account.locked.out.message.2", description: "Part of message for when user account has been locked out after multiple failed login attempts", defaultMessage: "To be on the safe side, you can {resetLink} before trying again.", values: { resetLink } }) })] }));
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
case INCORRECT_EMAIL_PASSWORD:
|
|
60
|
+
if (context.failureCount <= 1) {
|
|
61
|
+
errorMessage = _jsx("p", { children: formatMessage(messages['login.incorrect.credentials.error']) });
|
|
62
|
+
}
|
|
63
|
+
else if (context.failureCount === 2) {
|
|
64
|
+
errorMessage = (_jsx("p", { children: _jsx(FormattedMessage, { id: "login.incorrect.credentials.error.with.reset.link", defaultMessage: "The username, email, or password you entered is incorrect. Please try again or {resetLink}.", description: "An error message shown to users if some part of their login information was incorrect.", values: { resetLink } }) }));
|
|
65
|
+
}
|
|
66
|
+
break;
|
|
67
|
+
case NUDGE_PASSWORD_CHANGE:
|
|
68
|
+
// Need to clear the CSRF token here to fetch a new one because token is already rotated after successful login.
|
|
69
|
+
if (authService) {
|
|
70
|
+
authService.getCsrfTokenService().clearCsrfTokenCache();
|
|
71
|
+
}
|
|
72
|
+
return (_jsx(ChangePasswordPrompt, { redirectUrl: context.redirectUrl, variant: "nudge" }));
|
|
73
|
+
case REQUIRE_PASSWORD_CHANGE:
|
|
74
|
+
return _jsx(ChangePasswordPrompt, {});
|
|
75
|
+
case TPA_AUTHENTICATION_FAILURE:
|
|
76
|
+
errorMessage = (_jsx("p", { children: formatMessage(messages['login.tpa.authentication.failure'], {
|
|
77
|
+
platform_name: getSiteConfig().siteName,
|
|
78
|
+
lineBreak: _jsx("br", {}),
|
|
79
|
+
errorMessage: context.errorMessage,
|
|
80
|
+
}) }));
|
|
81
|
+
break;
|
|
82
|
+
case INTERNAL_SERVER_ERROR:
|
|
83
|
+
default:
|
|
84
|
+
errorMessage = _jsx("p", { children: formatMessage(messages['internal.server.error.message']) });
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
return (_jsxs(Alert, { id: "login-failure-alert", className: "mb-5", variant: "danger", icon: Error, children: [_jsx(Alert.Heading, { children: formatMessage(messages['login.failure.header.title']) }), errorMessage] }));
|
|
88
|
+
};
|
|
89
|
+
LoginFailureMessage.defaultProps = {
|
|
90
|
+
context: {},
|
|
91
|
+
};
|
|
92
|
+
LoginFailureMessage.propTypes = {
|
|
93
|
+
context: PropTypes.shape({
|
|
94
|
+
supportLink: PropTypes.string,
|
|
95
|
+
platformName: PropTypes.string,
|
|
96
|
+
tpaHint: PropTypes.string,
|
|
97
|
+
provider: PropTypes.string,
|
|
98
|
+
allowedDomain: PropTypes.string,
|
|
99
|
+
remainingAttempts: PropTypes.number,
|
|
100
|
+
failureCount: PropTypes.number,
|
|
101
|
+
errorMessage: PropTypes.string,
|
|
102
|
+
email: PropTypes.string,
|
|
103
|
+
redirectUrl: PropTypes.string,
|
|
104
|
+
}),
|
|
105
|
+
errorCode: PropTypes.string.isRequired,
|
|
106
|
+
errorCount: PropTypes.number.isRequired,
|
|
107
|
+
};
|
|
108
|
+
export default LoginFailureMessage;
|
|
109
|
+
//# sourceMappingURL=LoginFailure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoginFailure.js","sourceRoot":"","sources":["../../src/login/LoginFailure.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EACL,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,OAAO,EACzD,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/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Z,CAAC;AAEF,mBAAmB,CAAC,SAAS,GAAG;IAC9B,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC;QACvB,WAAW,EAAE,SAAS,CAAC,MAAM;QAC7B,YAAY,EAAE,SAAS,CAAC,MAAM;QAC9B,OAAO,EAAE,SAAS,CAAC,MAAM;QACzB,QAAQ,EAAE,SAAS,CAAC,MAAM;QAC1B,aAAa,EAAE,SAAS,CAAC,MAAM;QAC/B,iBAAiB,EAAE,SAAS,CAAC,MAAM;QACnC,YAAY,EAAE,SAAS,CAAC,MAAM;QAC9B,YAAY,EAAE,SAAS,CAAC,MAAM;QAC9B,KAAK,EAAE,SAAS,CAAC,MAAM;QACvB,WAAW,EAAE,SAAS,CAAC,MAAM;KAC9B,CAAC;IACF,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACtC,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;CACxC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { useEffect } from 'react';\n\nimport {\n FormattedMessage, getAuthService, getSiteConfig, useIntl\n} from '@openedx/frontend-base';\nimport { Alert, Hyperlink } from '@openedx/paragon';\nimport { Error } from '@openedx/paragon/icons';\nimport PropTypes from 'prop-types';\n\nimport { windowScrollTo } from '../data/utils';\nimport ChangePasswordPrompt from './ChangePasswordPrompt';\nimport {\n ACCOUNT_LOCKED_OUT,\n ALLOWED_DOMAIN_LOGIN_ERROR,\n FAILED_LOGIN_ATTEMPT,\n FORBIDDEN_REQUEST,\n INACTIVE_USER,\n INCORRECT_EMAIL_PASSWORD,\n INTERNAL_SERVER_ERROR,\n INVALID_FORM,\n NON_COMPLIANT_PASSWORD_EXCEPTION,\n NUDGE_PASSWORD_CHANGE,\n REQUIRE_PASSWORD_CHANGE,\n TPA_AUTHENTICATION_FAILURE,\n} from './data/constants';\nimport messages from './messages';\n\nconst LoginFailureMessage = (props) => {\n const { formatMessage } = useIntl();\n const authService = getAuthService();\n const {\n context,\n errorCode,\n errorCount, // This is used to trigger the useEffect, facilitating the scrolling to the top.\n } = props;\n\n useEffect(() => {\n windowScrollTo({ left: 0, top: 0, behavior: 'smooth' });\n }, [errorCode, errorCount]);\n\n if (!errorCode) {\n return null;\n }\n\n let resetLink = (\n <Hyperlink destination=\"reset\" isInline>\n {formatMessage(messages['login.incorrect.credentials.error.reset.link.text'])}\n </Hyperlink>\n );\n\n let errorMessage;\n switch (errorCode) {\n case NON_COMPLIANT_PASSWORD_EXCEPTION: {\n errorMessage = (\n <>\n <strong>{formatMessage(messages['non.compliant.password.title'])}</strong>\n <p>{formatMessage(messages['non.compliant.password.message'])}</p>\n </>\n );\n break;\n }\n case FORBIDDEN_REQUEST:\n errorMessage = <p>{formatMessage(messages['login.rate.limit.reached.message'])}</p>;\n break;\n case INACTIVE_USER: {\n const supportLink = (\n <a href={context.supportLink}>\n {formatMessage(messages['contact.support.link'], { platformName: context.platformName })}\n </a>\n );\n errorMessage = (\n <p>\n <FormattedMessage\n id=\"login.inactive.user.error\"\n defaultMessage=\"In order to sign in, you need to activate your account.{lineBreak}\n {lineBreak}We just sent an activation link to {email}. If you do not receive an email,\n check your spam folders or {supportLink}.\"\n description=\"An error message shown to users when they sign in if they have not yet activated their account. It attempts to explain to them how to activate their account by looking for an email from the system.\"\n values={{\n lineBreak: <br />,\n email: <strong className=\"data-hj-suppress\">{context.email}</strong>,\n supportLink,\n }}\n />\n </p>\n );\n break;\n }\n case ALLOWED_DOMAIN_LOGIN_ERROR: {\n const url = `${getSiteConfig().lmsBaseUrl}/dashboard/?tpa_hint=${context.tpaHint}`;\n const tpaLink = (\n <a href={url}>\n {formatMessage(messages['tpa.account.link'], { provider: context.provider })}\n </a>\n );\n errorMessage = (\n <p>\n <FormattedMessage\n id=\"allowed.domain.login.error\"\n description=\"Display this error message when staff user try to login through password\"\n defaultMessage=\"As {allowedDomain} user, You must login with your {allowedDomain} {tpaLink}.\"\n values={{ allowedDomain: context.allowedDomain, tpaLink }}\n />\n </p>\n );\n break;\n }\n case INVALID_FORM:\n errorMessage = <p>{formatMessage(messages['login.form.invalid.error.message'])}</p>;\n break;\n case FAILED_LOGIN_ATTEMPT: {\n resetLink = (\n <Hyperlink destination=\"reset\" isInline>\n {formatMessage(messages['login.incorrect.credentials.error.before.account.blocked.text'])}\n </Hyperlink>\n );\n errorMessage = (\n <>\n <p>\n <FormattedMessage\n id=\"login.incorrect.credentials.error.attempts.text.1\"\n description=\"Error message for incorrect email or password\"\n defaultMessage=\"The username, email or password you entered is incorrect. You have {remainingAttempts} more sign in\n attempts before your account is temporarily locked.\"\n values={{ remainingAttempts: context.remainingAttempts }}\n />\n </p>\n <p>\n <FormattedMessage\n id=\"login.incorrect.credentials.error.attempts.text.2\"\n description=\"Part of error message for incorrect email or password\"\n defaultMessage=\"If you've forgotten your password, {resetLink}\"\n values={{ resetLink }}\n />\n </p>\n </>\n );\n break;\n }\n case ACCOUNT_LOCKED_OUT: {\n errorMessage = (\n <>\n <p>{formatMessage(messages['account.locked.out.message.1'])}</p>\n <p>\n <FormattedMessage\n id=\"account.locked.out.message.2\"\n description=\"Part of message for when user account has been locked out after multiple failed login attempts\"\n defaultMessage=\"To be on the safe side, you can {resetLink} before trying again.\"\n values={{ resetLink }}\n />\n </p>\n </>\n );\n break;\n }\n case INCORRECT_EMAIL_PASSWORD:\n if (context.failureCount <= 1) {\n errorMessage = <p>{formatMessage(messages['login.incorrect.credentials.error'])}</p>;\n } else if (context.failureCount === 2) {\n errorMessage = (\n <p>\n <FormattedMessage\n id=\"login.incorrect.credentials.error.with.reset.link\"\n defaultMessage=\"The username, email, or password you entered is incorrect. Please try again or {resetLink}.\"\n description=\"An error message shown to users if some part of their login information was incorrect.\"\n values={{ resetLink }}\n />\n </p>\n );\n }\n break;\n case NUDGE_PASSWORD_CHANGE:\n // Need to clear the CSRF token here to fetch a new one because token is already rotated after successful login.\n if (authService) {\n authService.getCsrfTokenService().clearCsrfTokenCache();\n }\n return (\n <ChangePasswordPrompt\n redirectUrl={context.redirectUrl}\n variant=\"nudge\"\n />\n );\n case REQUIRE_PASSWORD_CHANGE:\n return <ChangePasswordPrompt />;\n case TPA_AUTHENTICATION_FAILURE:\n errorMessage = (\n <p>\n {formatMessage(messages['login.tpa.authentication.failure'], {\n platform_name: getSiteConfig().siteName,\n lineBreak: <br />,\n errorMessage: context.errorMessage,\n })}\n </p>\n );\n break;\n case INTERNAL_SERVER_ERROR:\n default:\n errorMessage = <p>{formatMessage(messages['internal.server.error.message'])}</p>;\n break;\n }\n\n return (\n <Alert id=\"login-failure-alert\" className=\"mb-5\" variant=\"danger\" icon={Error}>\n <Alert.Heading>{formatMessage(messages['login.failure.header.title'])}</Alert.Heading>\n {errorMessage}\n </Alert>\n );\n};\n\nLoginFailureMessage.defaultProps = {\n context: {},\n};\n\nLoginFailureMessage.propTypes = {\n context: PropTypes.shape({\n supportLink: PropTypes.string,\n platformName: PropTypes.string,\n tpaHint: PropTypes.string,\n provider: PropTypes.string,\n allowedDomain: PropTypes.string,\n remainingAttempts: PropTypes.number,\n failureCount: PropTypes.number,\n errorMessage: PropTypes.string,\n email: PropTypes.string,\n redirectUrl: PropTypes.string,\n }),\n errorCode: PropTypes.string.isRequired,\n errorCount: PropTypes.number.isRequired,\n};\n\nexport default LoginFailureMessage;\n"]}
|