@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.
Files changed (506) hide show
  1. package/dist/Main.d.ts +3 -0
  2. package/{src/Main.tsx → dist/Main.js} +4 -15
  3. package/dist/Main.js.map +1 -0
  4. package/dist/app.d.ts +3 -0
  5. package/dist/app.js +41 -0
  6. package/dist/app.js.map +1 -0
  7. package/dist/app.scss +2 -0
  8. package/dist/base-container/components/default-layout/LargeLayout.d.ts +2 -0
  9. package/dist/base-container/components/default-layout/LargeLayout.js +11 -0
  10. package/dist/base-container/components/default-layout/LargeLayout.js.map +1 -0
  11. package/dist/base-container/components/default-layout/MediumLayout.d.ts +2 -0
  12. package/dist/base-container/components/default-layout/MediumLayout.js +11 -0
  13. package/dist/base-container/components/default-layout/MediumLayout.js.map +1 -0
  14. package/dist/base-container/components/default-layout/SmallLayout.d.ts +2 -0
  15. package/dist/base-container/components/default-layout/SmallLayout.js +11 -0
  16. package/dist/base-container/components/default-layout/SmallLayout.js.map +1 -0
  17. package/dist/base-container/components/default-layout/index.d.ts +3 -0
  18. package/{src/base-container/components/default-layout/index.jsx → dist/base-container/components/default-layout/index.js} +1 -0
  19. package/dist/base-container/components/default-layout/index.js.map +1 -0
  20. package/dist/base-container/components/default-layout/messages.d.ts +13 -0
  21. package/dist/base-container/components/default-layout/messages.js +15 -0
  22. package/dist/base-container/components/default-layout/messages.js.map +1 -0
  23. package/dist/base-container/components/image-layout/ExtraSmallLayout.d.ts +2 -0
  24. package/dist/base-container/components/image-layout/ExtraSmallLayout.js +10 -0
  25. package/dist/base-container/components/image-layout/ExtraSmallLayout.js.map +1 -0
  26. package/dist/base-container/components/image-layout/LargeLayout.d.ts +2 -0
  27. package/dist/base-container/components/image-layout/LargeLayout.js +11 -0
  28. package/dist/base-container/components/image-layout/LargeLayout.js.map +1 -0
  29. package/dist/base-container/components/image-layout/MediumLayout.d.ts +2 -0
  30. package/dist/base-container/components/image-layout/MediumLayout.js +11 -0
  31. package/dist/base-container/components/image-layout/MediumLayout.js.map +1 -0
  32. package/dist/base-container/components/image-layout/SmallLayout.d.ts +2 -0
  33. package/dist/base-container/components/image-layout/SmallLayout.js +10 -0
  34. package/dist/base-container/components/image-layout/SmallLayout.js.map +1 -0
  35. package/dist/base-container/components/image-layout/index.d.ts +4 -0
  36. package/{src/base-container/components/image-layout/index.jsx → dist/base-container/components/image-layout/index.js} +1 -0
  37. package/dist/base-container/components/image-layout/index.js.map +1 -0
  38. package/dist/base-container/components/image-layout/messages.d.ts +13 -0
  39. package/dist/base-container/components/image-layout/messages.js +15 -0
  40. package/dist/base-container/components/image-layout/messages.js.map +1 -0
  41. package/dist/base-container/components/welcome-page-layout/LargeLayout.d.ts +10 -0
  42. package/dist/base-container/components/welcome-page-layout/LargeLayout.js +14 -0
  43. package/dist/base-container/components/welcome-page-layout/LargeLayout.js.map +1 -0
  44. package/dist/base-container/components/welcome-page-layout/MediumLayout.d.ts +10 -0
  45. package/dist/base-container/components/welcome-page-layout/MediumLayout.js +14 -0
  46. package/dist/base-container/components/welcome-page-layout/MediumLayout.js.map +1 -0
  47. package/dist/base-container/components/welcome-page-layout/SmallLayout.d.ts +10 -0
  48. package/dist/base-container/components/welcome-page-layout/SmallLayout.js +14 -0
  49. package/dist/base-container/components/welcome-page-layout/SmallLayout.js.map +1 -0
  50. package/dist/base-container/components/welcome-page-layout/index.d.ts +3 -0
  51. package/{src/base-container/components/welcome-page-layout/index.jsx → dist/base-container/components/welcome-page-layout/index.js} +1 -0
  52. package/dist/base-container/components/welcome-page-layout/index.js.map +1 -0
  53. package/dist/base-container/components/welcome-page-layout/messages.d.ts +18 -0
  54. package/dist/base-container/components/welcome-page-layout/messages.js +20 -0
  55. package/dist/base-container/components/welcome-page-layout/messages.js.map +1 -0
  56. package/dist/base-container/index.d.ts +20 -0
  57. package/dist/base-container/index.js +27 -0
  58. package/dist/base-container/index.js.map +1 -0
  59. package/dist/common-components/EmbeddedRegistrationRoute.d.ts +14 -0
  60. package/{src/common-components/EmbeddedRegistrationRoute.jsx → dist/common-components/EmbeddedRegistrationRoute.js} +9 -13
  61. package/dist/common-components/EmbeddedRegistrationRoute.js.map +1 -0
  62. package/dist/common-components/EnterpriseSSO.d.ts +29 -0
  63. package/dist/common-components/EnterpriseSSO.js +55 -0
  64. package/dist/common-components/EnterpriseSSO.js.map +1 -0
  65. package/dist/common-components/FormGroup.d.ts +60 -0
  66. package/dist/common-components/FormGroup.js +66 -0
  67. package/dist/common-components/FormGroup.js.map +1 -0
  68. package/dist/common-components/InstitutionLogistration.d.ts +34 -0
  69. package/dist/common-components/InstitutionLogistration.js +38 -0
  70. package/dist/common-components/InstitutionLogistration.js.map +1 -0
  71. package/dist/common-components/NotFoundPage.d.ts +2 -0
  72. package/dist/common-components/NotFoundPage.js +5 -0
  73. package/dist/common-components/NotFoundPage.js.map +1 -0
  74. package/dist/common-components/PasswordField.d.ts +39 -0
  75. package/dist/common-components/PasswordField.js +94 -0
  76. package/dist/common-components/PasswordField.js.map +1 -0
  77. package/dist/common-components/RedirectLogistration.d.ts +39 -0
  78. package/dist/common-components/RedirectLogistration.js +68 -0
  79. package/dist/common-components/RedirectLogistration.js.map +1 -0
  80. package/dist/common-components/RegisterFaIcons.d.ts +1 -0
  81. package/dist/common-components/RegisterFaIcons.js +6 -0
  82. package/dist/common-components/RegisterFaIcons.js.map +1 -0
  83. package/dist/common-components/SocialAuthProviders.d.ts +23 -0
  84. package/dist/common-components/SocialAuthProviders.js +42 -0
  85. package/dist/common-components/SocialAuthProviders.js.map +1 -0
  86. package/dist/common-components/ThirdPartyAuth.d.ts +42 -0
  87. package/dist/common-components/ThirdPartyAuth.js +56 -0
  88. package/dist/common-components/ThirdPartyAuth.js.map +1 -0
  89. package/dist/common-components/ThirdPartyAuthAlert.d.ts +15 -0
  90. package/dist/common-components/ThirdPartyAuthAlert.js +32 -0
  91. package/dist/common-components/ThirdPartyAuthAlert.js.map +1 -0
  92. package/dist/common-components/UnAuthOnlyRoute.d.ts +14 -0
  93. package/dist/common-components/UnAuthOnlyRoute.js +31 -0
  94. package/dist/common-components/UnAuthOnlyRoute.js.map +1 -0
  95. package/dist/common-components/data/actions.d.ts +26 -0
  96. package/{src → dist}/common-components/data/actions.js +8 -13
  97. package/dist/common-components/data/actions.js.map +1 -0
  98. package/dist/common-components/data/reducers.d.ts +62 -0
  99. package/dist/common-components/data/reducers.js +39 -0
  100. package/dist/common-components/data/reducers.js.map +1 -0
  101. package/dist/common-components/data/sagas.d.ts +12 -0
  102. package/dist/common-components/data/sagas.js +21 -0
  103. package/dist/common-components/data/sagas.js.map +1 -0
  104. package/dist/common-components/data/selectors.d.ts +98 -0
  105. package/dist/common-components/data/selectors.js +11 -0
  106. package/dist/common-components/data/selectors.js.map +1 -0
  107. package/dist/common-components/data/service.d.ts +5 -0
  108. package/dist/common-components/data/service.js +31 -0
  109. package/dist/common-components/data/service.js.map +1 -0
  110. package/dist/common-components/index.d.ts +13 -0
  111. package/{src/common-components/index.jsx → dist/common-components/index.js} +1 -0
  112. package/dist/common-components/index.js.map +1 -0
  113. package/dist/common-components/messages.d.ts +113 -0
  114. package/dist/common-components/messages.js +126 -0
  115. package/dist/common-components/messages.js.map +1 -0
  116. package/dist/constants.d.ts +1 -0
  117. package/{src/constants.ts → dist/constants.js} +1 -0
  118. package/dist/constants.js.map +1 -0
  119. package/dist/data/configureStore.d.ts +3 -0
  120. package/{src → dist}/data/configureStore.js +11 -20
  121. package/dist/data/configureStore.js.map +1 -0
  122. package/dist/data/constants.d.ts +24 -0
  123. package/{src → dist}/data/constants.js +4 -8
  124. package/dist/data/constants.js.map +1 -0
  125. package/dist/data/countries.d.ts +26 -0
  126. package/{src/data/countries.ts → dist/data/countries.js} +6 -9
  127. package/dist/data/countries.js.map +1 -0
  128. package/dist/data/oneTrust.d.ts +2 -0
  129. package/dist/data/oneTrust.js +3 -0
  130. package/dist/data/oneTrust.js.map +1 -0
  131. package/dist/data/reducers.d.ts +254 -0
  132. package/dist/data/reducers.js +17 -0
  133. package/dist/data/reducers.js.map +1 -0
  134. package/dist/data/sagas.d.ts +1 -0
  135. package/{src → dist}/data/sagas.js +9 -10
  136. package/dist/data/sagas.js.map +1 -0
  137. package/dist/data/utils/cookies.d.ts +1 -0
  138. package/dist/data/utils/cookies.js +12 -0
  139. package/dist/data/utils/cookies.js.map +1 -0
  140. package/dist/data/utils/dataUtils.d.ts +11 -0
  141. package/dist/data/utils/dataUtils.js +67 -0
  142. package/dist/data/utils/dataUtils.js.map +1 -0
  143. package/dist/data/utils/index.d.ts +3 -0
  144. package/dist/data/utils/index.js +4 -0
  145. package/dist/data/utils/index.js.map +1 -0
  146. package/dist/data/utils/reduxUtils.d.ts +15 -0
  147. package/dist/data/utils/reduxUtils.js +29 -0
  148. package/dist/data/utils/reduxUtils.js.map +1 -0
  149. package/dist/data/utils/useMobileResponsive.d.ts +7 -0
  150. package/dist/data/utils/useMobileResponsive.js +22 -0
  151. package/dist/data/utils/useMobileResponsive.js.map +1 -0
  152. package/dist/field-renderer/FieldRenderer.d.ts +34 -0
  153. package/dist/field-renderer/FieldRenderer.js +70 -0
  154. package/dist/field-renderer/FieldRenderer.js.map +1 -0
  155. package/dist/field-renderer/index.d.ts +1 -0
  156. package/{src/field-renderer/index.jsx → dist/field-renderer/index.js} +1 -0
  157. package/dist/field-renderer/index.js.map +1 -0
  158. package/dist/forgot-password/ForgotPasswordAlert.d.ts +16 -0
  159. package/dist/forgot-password/ForgotPasswordAlert.js +66 -0
  160. package/dist/forgot-password/ForgotPasswordAlert.js.map +1 -0
  161. package/dist/forgot-password/ForgotPasswordPage.d.ts +36 -0
  162. package/dist/forgot-password/ForgotPasswordPage.js +91 -0
  163. package/dist/forgot-password/ForgotPasswordPage.js.map +1 -0
  164. package/dist/forgot-password/data/actions.d.ts +30 -0
  165. package/{src → dist}/forgot-password/data/actions.js +10 -16
  166. package/dist/forgot-password/data/actions.js.map +1 -0
  167. package/dist/forgot-password/data/reducers.d.ts +13 -0
  168. package/dist/forgot-password/data/reducers.js +46 -0
  169. package/dist/forgot-password/data/reducers.js.map +1 -0
  170. package/dist/forgot-password/data/sagas.d.ts +4 -0
  171. package/dist/forgot-password/data/sagas.js +28 -0
  172. package/dist/forgot-password/data/sagas.js.map +1 -0
  173. package/dist/forgot-password/data/selectors.d.ts +23 -0
  174. package/dist/forgot-password/data/selectors.js +5 -0
  175. package/dist/forgot-password/data/selectors.js.map +1 -0
  176. package/dist/forgot-password/data/service.d.ts +1 -0
  177. package/dist/forgot-password/data/service.js +26 -0
  178. package/dist/forgot-password/data/service.js.map +1 -0
  179. package/dist/forgot-password/index.d.ts +5 -0
  180. package/{src → dist}/forgot-password/index.js +1 -0
  181. package/dist/forgot-password/index.js.map +1 -0
  182. package/dist/forgot-password/messages.d.ts +123 -0
  183. package/dist/forgot-password/messages.js +128 -0
  184. package/dist/forgot-password/messages.js.map +1 -0
  185. package/dist/i18n/index.d.ts +25 -0
  186. package/dist/i18n/index.js +26 -0
  187. package/dist/i18n/index.js.map +1 -0
  188. package/dist/index.js +4 -0
  189. package/dist/index.js.map +1 -0
  190. package/dist/login/AccountActivationMessage.d.ts +14 -0
  191. package/dist/login/AccountActivationMessage.js +49 -0
  192. package/dist/login/AccountActivationMessage.js.map +1 -0
  193. package/dist/login/ChangePasswordPrompt.d.ts +18 -0
  194. package/dist/login/ChangePasswordPrompt.js +45 -0
  195. package/dist/login/ChangePasswordPrompt.js.map +1 -0
  196. package/dist/login/LoginFailure.d.ts +25 -0
  197. package/dist/login/LoginFailure.js +109 -0
  198. package/dist/login/LoginFailure.js.map +1 -0
  199. package/dist/login/LoginPage.d.ts +10 -0
  200. package/dist/login/LoginPage.js +216 -0
  201. package/dist/login/LoginPage.js.map +1 -0
  202. package/dist/login/data/actions.d.ts +36 -0
  203. package/{src → dist}/login/data/actions.js +12 -19
  204. package/dist/login/data/actions.js.map +1 -0
  205. package/dist/login/data/constants.d.ts +17 -0
  206. package/{src → dist}/login/data/constants.js +4 -4
  207. package/dist/login/data/constants.js.map +1 -0
  208. package/dist/login/data/reducers.d.ts +82 -0
  209. package/dist/login/data/reducers.js +44 -0
  210. package/dist/login/data/reducers.js.map +1 -0
  211. package/dist/login/data/sagas.d.ts +10 -0
  212. package/dist/login/data/sagas.js +34 -0
  213. package/dist/login/data/sagas.js.map +1 -0
  214. package/dist/login/data/service.d.ts +4 -0
  215. package/dist/login/data/service.js +32 -0
  216. package/dist/login/data/service.js.map +1 -0
  217. package/dist/login/index.d.ts +4 -0
  218. package/{src → dist}/login/index.js +1 -1
  219. package/dist/login/index.js.map +1 -0
  220. package/dist/login/messages.d.ts +198 -0
  221. package/dist/login/messages.js +210 -0
  222. package/dist/login/messages.js.map +1 -0
  223. package/dist/logistration/Logistration.d.ts +32 -0
  224. package/dist/logistration/Logistration.js +106 -0
  225. package/dist/logistration/Logistration.js.map +1 -0
  226. package/dist/progressive-profiling/ProgressiveProfiling.d.ts +46 -0
  227. package/dist/progressive-profiling/ProgressiveProfiling.js +167 -0
  228. package/dist/progressive-profiling/ProgressiveProfiling.js.map +1 -0
  229. package/dist/progressive-profiling/ProgressiveProfilingPageModal.d.ts +13 -0
  230. package/dist/progressive-profiling/ProgressiveProfilingPageModal.js +24 -0
  231. package/dist/progressive-profiling/ProgressiveProfilingPageModal.js.map +1 -0
  232. package/dist/progressive-profiling/data/actions.d.ts +19 -0
  233. package/{src → dist}/progressive-profiling/data/actions.js +6 -10
  234. package/dist/progressive-profiling/data/actions.js.map +1 -0
  235. package/dist/progressive-profiling/data/reducers.d.ts +22 -0
  236. package/dist/progressive-profiling/data/reducers.js +23 -0
  237. package/dist/progressive-profiling/data/reducers.js.map +1 -0
  238. package/dist/progressive-profiling/data/sagas.d.ts +4 -0
  239. package/dist/progressive-profiling/data/sagas.js +17 -0
  240. package/dist/progressive-profiling/data/sagas.js.map +1 -0
  241. package/dist/progressive-profiling/data/selectors.d.ts +39 -0
  242. package/{src → dist}/progressive-profiling/data/selectors.js +4 -9
  243. package/dist/progressive-profiling/data/selectors.js.map +1 -0
  244. package/dist/progressive-profiling/data/service.d.ts +1 -0
  245. package/dist/progressive-profiling/data/service.js +23 -0
  246. package/dist/progressive-profiling/data/service.js.map +1 -0
  247. package/dist/progressive-profiling/index.d.ts +4 -0
  248. package/{src → dist}/progressive-profiling/index.js +1 -1
  249. package/dist/progressive-profiling/index.js.map +1 -0
  250. package/dist/progressive-profiling/messages.d.ts +53 -0
  251. package/dist/progressive-profiling/messages.js +57 -0
  252. package/dist/progressive-profiling/messages.js.map +1 -0
  253. package/dist/register/RegistrationFields/CountryField/CountryField.d.ts +38 -0
  254. package/dist/register/RegistrationFields/CountryField/CountryField.js +95 -0
  255. package/dist/register/RegistrationFields/CountryField/CountryField.js.map +1 -0
  256. package/dist/register/RegistrationFields/CountryField/validator.d.ts +8 -0
  257. package/dist/register/RegistrationFields/CountryField/validator.js +29 -0
  258. package/dist/register/RegistrationFields/CountryField/validator.js.map +1 -0
  259. package/dist/register/RegistrationFields/EmailField/EmailField.d.ts +30 -0
  260. package/dist/register/RegistrationFields/EmailField/EmailField.js +80 -0
  261. package/dist/register/RegistrationFields/EmailField/EmailField.js.map +1 -0
  262. package/dist/register/RegistrationFields/EmailField/constants.d.ts +3 -0
  263. package/dist/register/RegistrationFields/EmailField/constants.js +130 -0
  264. package/dist/register/RegistrationFields/EmailField/constants.js.map +1 -0
  265. package/dist/register/RegistrationFields/EmailField/validator.d.ts +17 -0
  266. package/dist/register/RegistrationFields/EmailField/validator.js +107 -0
  267. package/dist/register/RegistrationFields/EmailField/validator.js.map +1 -0
  268. package/dist/register/RegistrationFields/HonorCodeField/HonorCode.d.ts +21 -0
  269. package/dist/register/RegistrationFields/HonorCodeField/HonorCode.js +40 -0
  270. package/dist/register/RegistrationFields/HonorCodeField/HonorCode.js.map +1 -0
  271. package/dist/register/RegistrationFields/NameField/NameField.d.ts +29 -0
  272. package/dist/register/RegistrationFields/NameField/NameField.js +52 -0
  273. package/dist/register/RegistrationFields/NameField/NameField.js.map +1 -0
  274. package/dist/register/RegistrationFields/NameField/validator.d.ts +5 -0
  275. package/{src → dist}/register/RegistrationFields/NameField/validator.js +9 -12
  276. package/dist/register/RegistrationFields/NameField/validator.js.map +1 -0
  277. package/dist/register/RegistrationFields/TermsOfServiceField/TermsOfService.d.ts +16 -0
  278. package/dist/register/RegistrationFields/TermsOfServiceField/TermsOfService.js +24 -0
  279. package/dist/register/RegistrationFields/TermsOfServiceField/TermsOfService.js.map +1 -0
  280. package/dist/register/RegistrationFields/UsernameField/UsernameField.d.ts +31 -0
  281. package/dist/register/RegistrationFields/UsernameField/UsernameField.js +113 -0
  282. package/dist/register/RegistrationFields/UsernameField/UsernameField.js.map +1 -0
  283. package/dist/register/RegistrationFields/UsernameField/validator.d.ts +4 -0
  284. package/dist/register/RegistrationFields/UsernameField/validator.js +15 -0
  285. package/dist/register/RegistrationFields/UsernameField/validator.js.map +1 -0
  286. package/dist/register/RegistrationFields/index.d.ts +6 -0
  287. package/{src → dist}/register/RegistrationFields/index.js +1 -0
  288. package/dist/register/RegistrationFields/index.js.map +1 -0
  289. package/dist/register/RegistrationPage.d.ts +18 -0
  290. package/dist/register/RegistrationPage.js +216 -0
  291. package/dist/register/RegistrationPage.js.map +1 -0
  292. package/dist/register/components/ConfigurableRegistrationForm.d.ts +37 -0
  293. package/dist/register/components/ConfigurableRegistrationForm.js +145 -0
  294. package/dist/register/components/ConfigurableRegistrationForm.js.map +1 -0
  295. package/dist/register/components/RegistrationFailure.d.ts +19 -0
  296. package/dist/register/components/RegistrationFailure.js +57 -0
  297. package/dist/register/components/RegistrationFailure.js.map +1 -0
  298. package/dist/register/data/actions.d.ts +80 -0
  299. package/{src → dist}/register/data/actions.js +26 -42
  300. package/dist/register/data/actions.js.map +1 -0
  301. package/dist/register/data/constants.d.ts +10 -0
  302. package/{src → dist}/register/data/constants.js +4 -4
  303. package/dist/register/data/constants.js.map +1 -0
  304. package/dist/register/data/reducers.d.ts +237 -0
  305. package/dist/register/data/reducers.js +86 -0
  306. package/dist/register/data/reducers.js.map +1 -0
  307. package/dist/register/data/sagas.d.ts +19 -0
  308. package/dist/register/data/sagas.js +45 -0
  309. package/dist/register/data/sagas.js.map +1 -0
  310. package/dist/register/data/selectors.d.ts +26 -0
  311. package/dist/register/data/selectors.js +25 -0
  312. package/dist/register/data/selectors.js.map +1 -0
  313. package/dist/register/data/service.d.ts +8 -0
  314. package/dist/register/data/service.js +46 -0
  315. package/dist/register/data/service.js.map +1 -0
  316. package/dist/register/data/utils.d.ts +6 -0
  317. package/dist/register/data/utils.js +128 -0
  318. package/dist/register/data/utils.js.map +1 -0
  319. package/dist/register/index.d.ts +3 -0
  320. package/{src → dist}/register/index.js +1 -0
  321. package/dist/register/index.js.map +1 -0
  322. package/dist/register/messages.d.ts +193 -0
  323. package/dist/register/messages.js +205 -0
  324. package/dist/register/messages.js.map +1 -0
  325. package/dist/reset-password/ResetPasswordFailure.d.ts +15 -0
  326. package/dist/reset-password/ResetPasswordFailure.js +44 -0
  327. package/dist/reset-password/ResetPasswordFailure.js.map +1 -0
  328. package/dist/reset-password/ResetPasswordPage.d.ts +32 -0
  329. package/dist/reset-password/ResetPasswordPage.js +150 -0
  330. package/dist/reset-password/ResetPasswordPage.js.map +1 -0
  331. package/dist/reset-password/ResetPasswordSuccess.d.ts +2 -0
  332. package/dist/reset-password/ResetPasswordSuccess.js +10 -0
  333. package/dist/reset-password/ResetPasswordSuccess.js.map +1 -0
  334. package/dist/reset-password/data/actions.d.ts +56 -0
  335. package/{src → dist}/reset-password/data/actions.js +17 -26
  336. package/dist/reset-password/data/actions.js.map +1 -0
  337. package/dist/reset-password/data/constants.d.ts +13 -0
  338. package/{src → dist}/reset-password/data/constants.js +6 -7
  339. package/dist/reset-password/data/constants.js.map +1 -0
  340. package/dist/reset-password/data/reducers.d.ts +19 -0
  341. package/dist/reset-password/data/reducers.js +25 -0
  342. package/dist/reset-password/data/reducers.js.map +1 -0
  343. package/dist/reset-password/data/sagas.d.ts +7 -0
  344. package/dist/reset-password/data/sagas.js +63 -0
  345. package/dist/reset-password/data/sagas.js.map +1 -0
  346. package/dist/reset-password/data/selectors.d.ts +23 -0
  347. package/dist/reset-password/data/selectors.js +5 -0
  348. package/dist/reset-password/data/selectors.js.map +1 -0
  349. package/dist/reset-password/data/service.d.ts +3 -0
  350. package/dist/reset-password/data/service.js +62 -0
  351. package/dist/reset-password/data/service.js.map +1 -0
  352. package/dist/reset-password/index.d.ts +5 -0
  353. package/{src → dist}/reset-password/index.js +1 -0
  354. package/dist/reset-password/index.js.map +1 -0
  355. package/dist/reset-password/messages.d.ts +83 -0
  356. package/dist/reset-password/messages.js +87 -0
  357. package/dist/reset-password/messages.js.map +1 -0
  358. package/dist/routes.d.ts +18 -0
  359. package/dist/routes.js +75 -0
  360. package/dist/routes.js.map +1 -0
  361. package/{src → dist}/sass/_base_component.scss +57 -54
  362. package/{src → dist}/sass/_progressive_profiling_page.scss +1 -3
  363. package/{src → dist}/sass/_registration.scss +7 -8
  364. package/{src → dist}/sass/_style.scss +40 -43
  365. package/package.json +17 -6
  366. package/src/__mocks__/file.js +0 -1
  367. package/src/__mocks__/svg.js +0 -1
  368. package/src/app.scss +0 -6
  369. package/src/app.ts +0 -43
  370. package/src/base-container/components/default-layout/DefaultLayout.test.jsx +0 -48
  371. package/src/base-container/components/default-layout/LargeLayout.jsx +0 -42
  372. package/src/base-container/components/default-layout/MediumLayout.jsx +0 -49
  373. package/src/base-container/components/default-layout/SmallLayout.jsx +0 -37
  374. package/src/base-container/components/default-layout/messages.js +0 -16
  375. package/src/base-container/components/image-layout/ExtraSmallLayout.jsx +0 -31
  376. package/src/base-container/components/image-layout/LargeLayout.jsx +0 -32
  377. package/src/base-container/components/image-layout/MediumLayout.jsx +0 -32
  378. package/src/base-container/components/image-layout/SmallLayout.jsx +0 -31
  379. package/src/base-container/components/image-layout/messages.js +0 -16
  380. package/src/base-container/components/welcome-page-layout/LargeLayout.jsx +0 -46
  381. package/src/base-container/components/welcome-page-layout/MediumLayout.jsx +0 -49
  382. package/src/base-container/components/welcome-page-layout/SmallLayout.jsx +0 -38
  383. package/src/base-container/components/welcome-page-layout/messages.js +0 -21
  384. package/src/base-container/index.jsx +0 -70
  385. package/src/base-container/tests/BaseContainer.test.jsx +0 -44
  386. package/src/common-components/EnterpriseSSO.jsx +0 -110
  387. package/src/common-components/FormGroup.jsx +0 -106
  388. package/src/common-components/InstitutionLogistration.jsx +0 -102
  389. package/src/common-components/NotFoundPage.jsx +0 -15
  390. package/src/common-components/PasswordField.jsx +0 -175
  391. package/src/common-components/RedirectLogistration.jsx +0 -94
  392. package/src/common-components/RegisterFaIcons.jsx +0 -8
  393. package/src/common-components/SocialAuthProviders.jsx +0 -75
  394. package/src/common-components/ThirdPartyAuth.jsx +0 -123
  395. package/src/common-components/ThirdPartyAuthAlert.jsx +0 -49
  396. package/src/common-components/UnAuthOnlyRoute.jsx +0 -41
  397. package/src/common-components/data/reducers.js +0 -63
  398. package/src/common-components/data/sagas.js +0 -32
  399. package/src/common-components/data/selectors.js +0 -28
  400. package/src/common-components/data/service.js +0 -23
  401. package/src/common-components/data/tests/reducer.test.js +0 -82
  402. package/src/common-components/data/tests/sagas.test.js +0 -71
  403. package/src/common-components/messages.jsx +0 -127
  404. package/src/common-components/tests/EmbeddedRegistrationRoute.test.jsx +0 -76
  405. package/src/common-components/tests/FormField.test.jsx +0 -289
  406. package/src/common-components/tests/SocialAuthProviders.test.jsx +0 -75
  407. package/src/common-components/tests/ThirdPartyAuthAlert.test.jsx +0 -39
  408. package/src/common-components/tests/UnAuthOnlyRoute.test.jsx +0 -73
  409. package/src/common-components/tests/__snapshots__/SocialAuthProviders.test.jsx.snap +0 -156
  410. package/src/common-components/tests/__snapshots__/ThirdPartyAuthAlert.test.jsx.snap +0 -53
  411. package/src/data/oneTrust.js +0 -3
  412. package/src/data/reducers.js +0 -36
  413. package/src/data/tests/cookies.test.js +0 -42
  414. package/src/data/tests/dataUtils.test.js +0 -19
  415. package/src/data/tests/reduxUtils.test.js +0 -14
  416. package/src/data/utils/cookies.js +0 -12
  417. package/src/data/utils/dataUtils.js +0 -81
  418. package/src/data/utils/index.js +0 -11
  419. package/src/data/utils/reduxUtils.js +0 -34
  420. package/src/data/utils/useMobileResponsive.js +0 -24
  421. package/src/field-renderer/FieldRenderer.jsx +0 -156
  422. package/src/field-renderer/tests/FieldRenderer.test.jsx +0 -201
  423. package/src/forgot-password/ForgotPasswordAlert.jsx +0 -97
  424. package/src/forgot-password/ForgotPasswordPage.jsx +0 -193
  425. package/src/forgot-password/data/reducers.js +0 -58
  426. package/src/forgot-password/data/sagas.js +0 -35
  427. package/src/forgot-password/data/selectors.js +0 -10
  428. package/src/forgot-password/data/service.js +0 -21
  429. package/src/forgot-password/data/tests/reducers.test.js +0 -34
  430. package/src/forgot-password/data/tests/sagas.test.js +0 -67
  431. package/src/forgot-password/messages.js +0 -128
  432. package/src/forgot-password/tests/ForgotPasswordPage.test.jsx +0 -269
  433. package/src/i18n/index.js +0 -25
  434. package/src/login/AccountActivationMessage.jsx +0 -78
  435. package/src/login/ChangePasswordPrompt.jsx +0 -91
  436. package/src/login/LoginFailure.jsx +0 -231
  437. package/src/login/LoginPage.jsx +0 -368
  438. package/src/login/data/reducers.js +0 -76
  439. package/src/login/data/sagas.js +0 -45
  440. package/src/login/data/service.js +0 -27
  441. package/src/login/data/tests/reducers.test.js +0 -155
  442. package/src/login/data/tests/sagas.test.js +0 -110
  443. package/src/login/messages.jsx +0 -211
  444. package/src/login/tests/AccountActivationMessage.test.jsx +0 -122
  445. package/src/login/tests/ChangePasswordPrompt.test.jsx +0 -75
  446. package/src/login/tests/LoginFailure.test.jsx +0 -323
  447. package/src/login/tests/LoginPage.test.jsx +0 -839
  448. package/src/logistration/Logistration.jsx +0 -189
  449. package/src/logistration/Logistration.test.jsx +0 -275
  450. package/src/progressive-profiling/ProgressiveProfiling.jsx +0 -313
  451. package/src/progressive-profiling/ProgressiveProfilingPageModal.jsx +0 -56
  452. package/src/progressive-profiling/data/reducers.js +0 -38
  453. package/src/progressive-profiling/data/sagas.js +0 -24
  454. package/src/progressive-profiling/data/service.js +0 -17
  455. package/src/progressive-profiling/messages.jsx +0 -57
  456. package/src/progressive-profiling/tests/ProgressiveProfiling.test.jsx +0 -322
  457. package/src/register/RegistrationFields/CountryField/CountryField.jsx +0 -164
  458. package/src/register/RegistrationFields/CountryField/CountryField.test.jsx +0 -204
  459. package/src/register/RegistrationFields/CountryField/validator.js +0 -32
  460. package/src/register/RegistrationFields/EmailField/EmailField.jsx +0 -140
  461. package/src/register/RegistrationFields/EmailField/EmailField.test.jsx +0 -236
  462. package/src/register/RegistrationFields/EmailField/constants.js +0 -131
  463. package/src/register/RegistrationFields/EmailField/validator.js +0 -126
  464. package/src/register/RegistrationFields/EmailField/validator.test.js +0 -39
  465. package/src/register/RegistrationFields/HonorCodeField/HonorCode.jsx +0 -104
  466. package/src/register/RegistrationFields/HonorCodeField/HonorCode.test.jsx +0 -70
  467. package/src/register/RegistrationFields/NameField/NameField.jsx +0 -68
  468. package/src/register/RegistrationFields/NameField/NameField.test.jsx +0 -146
  469. package/src/register/RegistrationFields/TermsOfServiceField/TermsOfService.jsx +0 -58
  470. package/src/register/RegistrationFields/TermsOfServiceField/TermsOfService.test.jsx +0 -55
  471. package/src/register/RegistrationFields/UsernameField/UsernameField.jsx +0 -162
  472. package/src/register/RegistrationFields/UsernameField/UsernameField.test.jsx +0 -319
  473. package/src/register/RegistrationFields/UsernameField/validator.js +0 -16
  474. package/src/register/RegistrationPage.jsx +0 -428
  475. package/src/register/RegistrationPage.test.jsx +0 -854
  476. package/src/register/components/ConfigurableRegistrationForm.jsx +0 -244
  477. package/src/register/components/RegistrationFailure.jsx +0 -80
  478. package/src/register/components/tests/ConfigurableRegistrationForm.test.jsx +0 -401
  479. package/src/register/components/tests/RegistrationFailure.test.jsx +0 -212
  480. package/src/register/components/tests/ThirdPartyAuth.test.jsx +0 -439
  481. package/src/register/data/reducers.js +0 -140
  482. package/src/register/data/sagas.js +0 -58
  483. package/src/register/data/selectors.js +0 -34
  484. package/src/register/data/service.js +0 -45
  485. package/src/register/data/tests/reducers.test.js +0 -277
  486. package/src/register/data/tests/sagas.test.js +0 -239
  487. package/src/register/data/tests/utils.test.js +0 -98
  488. package/src/register/data/utils.js +0 -153
  489. package/src/register/messages.jsx +0 -206
  490. package/src/reset-password/ResetPasswordFailure.jsx +0 -55
  491. package/src/reset-password/ResetPasswordPage.jsx +0 -224
  492. package/src/reset-password/ResetPasswordSuccess.jsx +0 -19
  493. package/src/reset-password/data/reducers.js +0 -44
  494. package/src/reset-password/data/sagas.js +0 -67
  495. package/src/reset-password/data/selectors.js +0 -10
  496. package/src/reset-password/data/service.js +0 -61
  497. package/src/reset-password/data/tests/sagas.test.js +0 -185
  498. package/src/reset-password/messages.js +0 -88
  499. package/src/reset-password/tests/ResetPasswordPage.test.jsx +0 -241
  500. package/src/routes.jsx +0 -79
  501. package/src/setupTest.js +0 -68
  502. /package/{src → dist}/base-container/components/image-layout/index.scss +0 -0
  503. /package/{src/index.ts → dist/index.d.ts} +0 -0
  504. /package/{src → dist}/sass/_forgot_password.scss +0 -0
  505. /package/{src → dist}/sass/_login_page.scss +0 -0
  506. /package/{src → dist}/sass/_reset_password.scss +0 -0
@@ -0,0 +1,32 @@
1
+ declare const _default: import("react-redux").ConnectedComponent<{
2
+ (props: any): import("react/jsx-runtime").JSX.Element;
3
+ defaultProps: {
4
+ status: null;
5
+ token: null;
6
+ errorMsg: null;
7
+ };
8
+ propTypes: {
9
+ resetPassword: PropTypes.Validator<(...args: any[]) => any>;
10
+ validateToken: PropTypes.Validator<(...args: any[]) => any>;
11
+ token: PropTypes.Requireable<string>;
12
+ status: PropTypes.Requireable<string>;
13
+ errorMsg: PropTypes.Requireable<string>;
14
+ };
15
+ }, {
16
+ status?: string | null | undefined;
17
+ resetPassword: (...args: any[]) => any;
18
+ errorMsg?: string | null | undefined;
19
+ validateToken: (...args: any[]) => any;
20
+ token?: string | null | undefined;
21
+ context?: import("react-redux/es/components/Context").ReactReduxContextInstance | undefined;
22
+ store?: import("redux").Store | undefined;
23
+ } | {
24
+ status?: string | null | undefined;
25
+ resetPassword: (...args: any[]) => any;
26
+ errorMsg?: string | null | undefined;
27
+ validateToken: (...args: any[]) => any;
28
+ token?: string | null | undefined;
29
+ store?: import("redux").Store | undefined;
30
+ }>;
31
+ export default _default;
32
+ import PropTypes from 'prop-types';
@@ -0,0 +1,150 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { useEffect, useState } from 'react';
12
+ import { connect } from 'react-redux';
13
+ import { getSiteConfig, useIntl } from '@openedx/frontend-base';
14
+ import { Form, Icon, Spinner, StatefulButton, Tab, Tabs, } from '@openedx/paragon';
15
+ import { ChevronLeft } from '@openedx/paragon/icons';
16
+ import PropTypes from 'prop-types';
17
+ import { Helmet } from 'react-helmet';
18
+ import { useNavigate, useParams } from 'react-router-dom';
19
+ import BaseContainer from '../base-container';
20
+ import { PasswordField } from '../common-components';
21
+ import { LETTER_REGEX, LOGIN_PAGE, NUMBER_REGEX, RESET_PAGE, } from '../data/constants';
22
+ import { getAllPossibleQueryParams, updatePathWithQueryParams, windowScrollTo } from '../data/utils';
23
+ import { resetPassword, validateToken } from './data/actions';
24
+ import { FORM_SUBMISSION_ERROR, PASSWORD_RESET_ERROR, PASSWORD_VALIDATION_ERROR, TOKEN_STATE, } from './data/constants';
25
+ import { resetPasswordResultSelector } from './data/selectors';
26
+ import { validatePassword } from './data/service';
27
+ import messages from './messages';
28
+ import ResetPasswordFailure from './ResetPasswordFailure';
29
+ const ResetPasswordPage = (props) => {
30
+ const { formatMessage } = useIntl();
31
+ const newPasswordError = formatMessage(messages['password.validation.message']);
32
+ const [newPassword, setNewPassword] = useState('');
33
+ const [confirmPassword, setConfirmPassword] = useState('');
34
+ const [formErrors, setFormErrors] = useState({});
35
+ const [errorCode, setErrorCode] = useState(null);
36
+ const { token } = useParams();
37
+ const navigate = useNavigate();
38
+ useEffect(() => {
39
+ if (props.status === PASSWORD_RESET_ERROR) {
40
+ navigate(updatePathWithQueryParams(RESET_PAGE));
41
+ }
42
+ if (props.status === 'success') {
43
+ navigate(updatePathWithQueryParams(LOGIN_PAGE));
44
+ }
45
+ if (props.status !== TOKEN_STATE.PENDING) {
46
+ setErrorCode(props.status);
47
+ }
48
+ if (props.status === PASSWORD_VALIDATION_ERROR) {
49
+ setFormErrors({ newPassword: newPasswordError });
50
+ }
51
+ }, [props.status]);
52
+ const validatePasswordFromBackend = (password) => __awaiter(void 0, void 0, void 0, function* () {
53
+ let errorMessage = '';
54
+ try {
55
+ const payload = {
56
+ reset_password_page: true,
57
+ password,
58
+ };
59
+ errorMessage = yield validatePassword(payload);
60
+ }
61
+ catch (err) {
62
+ errorMessage = '';
63
+ }
64
+ setFormErrors(Object.assign(Object.assign({}, formErrors), { newPassword: errorMessage }));
65
+ });
66
+ const validateInput = (name, value) => {
67
+ switch (name) {
68
+ case 'newPassword':
69
+ if (!value || !LETTER_REGEX.test(value) || !NUMBER_REGEX.test(value) || value.length < 8) {
70
+ formErrors.newPassword = formatMessage(messages['password.validation.message']);
71
+ }
72
+ else {
73
+ validatePasswordFromBackend(value);
74
+ }
75
+ break;
76
+ case 'confirmPassword':
77
+ if (!value) {
78
+ formErrors.confirmPassword = formatMessage(messages['confirm.your.password']);
79
+ }
80
+ else if (value !== newPassword) {
81
+ formErrors.confirmPassword = formatMessage(messages['passwords.do.not.match']);
82
+ }
83
+ else {
84
+ formErrors.confirmPassword = '';
85
+ }
86
+ break;
87
+ default:
88
+ break;
89
+ }
90
+ setFormErrors(Object.assign({}, formErrors));
91
+ return !Object.values(formErrors).some(x => (x !== ''));
92
+ };
93
+ const handleOnBlur = (event) => {
94
+ const { name, value } = event.target;
95
+ validateInput(name, value);
96
+ };
97
+ const handleConfirmPasswordChange = (e) => {
98
+ const { value } = e.target;
99
+ setConfirmPassword(value);
100
+ validateInput('confirmPassword', value);
101
+ };
102
+ const handleOnFocus = (e) => {
103
+ setFormErrors(Object.assign(Object.assign({}, formErrors), { [e.target.name]: '' }));
104
+ };
105
+ const handleSubmit = (e) => {
106
+ e.preventDefault();
107
+ const isPasswordValid = validateInput('newPassword', newPassword);
108
+ const isPasswordConfirmed = validateInput('confirmPassword', confirmPassword);
109
+ if (isPasswordValid && isPasswordConfirmed) {
110
+ const formPayload = {
111
+ new_password1: newPassword,
112
+ new_password2: confirmPassword,
113
+ };
114
+ const params = getAllPossibleQueryParams();
115
+ props.resetPassword(formPayload, props.token, params);
116
+ }
117
+ else {
118
+ setErrorCode(FORM_SUBMISSION_ERROR);
119
+ windowScrollTo({ left: 0, top: 0, behavior: 'smooth' });
120
+ }
121
+ };
122
+ const tabTitle = (_jsxs("div", { className: "d-inline-flex flex-wrap align-items-center", children: [_jsx(Icon, { src: ChevronLeft }), _jsx("span", { className: "ml-2", children: formatMessage(messages['sign.in']) })] }));
123
+ if (props.status === TOKEN_STATE.PENDING && token) {
124
+ props.validateToken(token);
125
+ return (_jsx(Spinner, { animation: "border", variant: "primary", className: "spinner--position-centered" }));
126
+ }
127
+ else {
128
+ return (_jsx(BaseContainer, { children: _jsxs("div", { children: [_jsx(Helmet, { children: _jsx("title", { children: formatMessage(messages['reset.password.page.title'], { siteName: getSiteConfig().siteName }) }) }), _jsx(Tabs, { activeKey: "", id: "controlled-tab", onSelect: (key) => navigate(updatePathWithQueryParams(key)), children: _jsx(Tab, { title: tabTitle, eventKey: LOGIN_PAGE }) }), _jsx("div", { id: "main-content", className: "main-content", children: _jsxs("div", { className: "mw-xs", children: [_jsx(ResetPasswordFailure, { errorCode: errorCode, errorMsg: props.errorMsg }), _jsx("h4", { children: formatMessage(messages['reset.password']) }), _jsx("p", { className: "mb-4", children: formatMessage(messages['reset.password.page.instructions']) }), _jsxs(Form, { id: "set-reset-password-form", name: "set-reset-password-form", children: [_jsx(PasswordField, { name: "newPassword", value: newPassword, handleChange: (e) => setNewPassword(e.target.value), handleBlur: handleOnBlur, handleFocus: handleOnFocus, errorMessage: formErrors.newPassword, floatingLabel: formatMessage(messages['new.password.label']) }), _jsx(PasswordField, { name: "confirmPassword", value: confirmPassword, handleChange: handleConfirmPasswordChange, handleFocus: handleOnFocus, errorMessage: formErrors.confirmPassword, showRequirements: false, floatingLabel: formatMessage(messages['confirm.password.label']) }), _jsx(StatefulButton, { id: "submit-new-password", name: "submit-new-password", type: "submit", variant: "brand", className: "reset-password--button", state: props.status, labels: {
129
+ default: formatMessage(messages['reset.password']),
130
+ pending: '',
131
+ }, onClick: e => handleSubmit(e), onMouseDown: (e) => e.preventDefault() })] })] }) })] }) }));
132
+ }
133
+ };
134
+ ResetPasswordPage.defaultProps = {
135
+ status: null,
136
+ token: null,
137
+ errorMsg: null,
138
+ };
139
+ ResetPasswordPage.propTypes = {
140
+ resetPassword: PropTypes.func.isRequired,
141
+ validateToken: PropTypes.func.isRequired,
142
+ token: PropTypes.string,
143
+ status: PropTypes.string,
144
+ errorMsg: PropTypes.string,
145
+ };
146
+ export default connect(resetPasswordResultSelector, {
147
+ resetPassword,
148
+ validateToken,
149
+ })(ResetPasswordPage);
150
+ //# sourceMappingURL=ResetPasswordPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResetPasswordPage.js","sourceRoot":"","sources":["../../src/reset-password/ResetPasswordPage.jsx"],"names":[],"mappings":";;;;;;;;;;AAAA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AAG;IAC/B,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF,iBAAiB,CAAC,SAAS,GAAG;IAC5B,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,KAAK,EAAE,SAAS,CAAC,MAAM;IACvB,MAAM,EAAE,SAAS,CAAC,MAAM;IACxB,QAAQ,EAAE,SAAS,CAAC,MAAM;CAC3B,CAAC;AAEF,eAAe,OAAO,CACpB,2BAA2B,EAC3B;IACE,aAAa;IACb,aAAa;CACd,CACF,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { connect } from 'react-redux';\n\nimport { getSiteConfig, useIntl } from '@openedx/frontend-base';\nimport {\n Form,\n Icon,\n Spinner,\n StatefulButton,\n Tab,\n Tabs,\n} from '@openedx/paragon';\nimport { ChevronLeft } from '@openedx/paragon/icons';\nimport PropTypes from 'prop-types';\nimport { Helmet } from 'react-helmet';\nimport { useNavigate, useParams } from 'react-router-dom';\n\nimport BaseContainer from '../base-container';\nimport { PasswordField } from '../common-components';\nimport {\n LETTER_REGEX, LOGIN_PAGE, NUMBER_REGEX, RESET_PAGE,\n} from '../data/constants';\nimport { getAllPossibleQueryParams, updatePathWithQueryParams, windowScrollTo } from '../data/utils';\nimport { resetPassword, validateToken } from './data/actions';\nimport {\n FORM_SUBMISSION_ERROR, PASSWORD_RESET_ERROR, PASSWORD_VALIDATION_ERROR, TOKEN_STATE,\n} from './data/constants';\nimport { resetPasswordResultSelector } from './data/selectors';\nimport { validatePassword } from './data/service';\nimport messages from './messages';\nimport ResetPasswordFailure from './ResetPasswordFailure';\n\nconst ResetPasswordPage = (props) => {\n const { formatMessage } = useIntl();\n const newPasswordError = formatMessage(messages['password.validation.message']);\n\n const [newPassword, setNewPassword] = useState('');\n const [confirmPassword, setConfirmPassword] = useState('');\n const [formErrors, setFormErrors] = useState({});\n const [errorCode, setErrorCode] = useState(null);\n const { token } = useParams();\n const navigate = useNavigate();\n\n useEffect(() => {\n if (props.status === PASSWORD_RESET_ERROR) {\n navigate(updatePathWithQueryParams(RESET_PAGE));\n }\n if (props.status === 'success') {\n navigate(updatePathWithQueryParams(LOGIN_PAGE));\n }\n if (props.status !== TOKEN_STATE.PENDING) {\n setErrorCode(props.status);\n }\n if (props.status === PASSWORD_VALIDATION_ERROR) {\n setFormErrors({ newPassword: newPasswordError });\n }\n }, [props.status]);\n\n const validatePasswordFromBackend = async (password) => {\n let errorMessage = '';\n try {\n const payload = {\n reset_password_page: true,\n password,\n };\n errorMessage = await validatePassword(payload);\n } catch (err) {\n errorMessage = '';\n }\n setFormErrors({ ...formErrors, newPassword: errorMessage });\n };\n\n const validateInput = (name, value) => {\n switch (name) {\n case 'newPassword':\n if (!value || !LETTER_REGEX.test(value) || !NUMBER_REGEX.test(value) || value.length < 8) {\n formErrors.newPassword = formatMessage(messages['password.validation.message']);\n } else {\n validatePasswordFromBackend(value);\n }\n break;\n case 'confirmPassword':\n if (!value) {\n formErrors.confirmPassword = formatMessage(messages['confirm.your.password']);\n } else if (value !== newPassword) {\n formErrors.confirmPassword = formatMessage(messages['passwords.do.not.match']);\n } else {\n formErrors.confirmPassword = '';\n }\n break;\n default:\n break;\n }\n setFormErrors({ ...formErrors });\n return !Object.values(formErrors).some(x => (x !== ''));\n };\n\n const handleOnBlur = (event) => {\n const { name, value } = event.target;\n validateInput(name, value);\n };\n\n const handleConfirmPasswordChange = (e) => {\n const { value } = e.target;\n\n setConfirmPassword(value);\n validateInput('confirmPassword', value);\n };\n\n const handleOnFocus = (e) => {\n setFormErrors({ ...formErrors, [e.target.name]: '' });\n };\n\n const handleSubmit = (e) => {\n e.preventDefault();\n\n const isPasswordValid = validateInput('newPassword', newPassword);\n const isPasswordConfirmed = validateInput('confirmPassword', confirmPassword);\n\n if (isPasswordValid && isPasswordConfirmed) {\n const formPayload = {\n new_password1: newPassword,\n new_password2: confirmPassword,\n };\n const params = getAllPossibleQueryParams();\n props.resetPassword(formPayload, props.token, params);\n } else {\n setErrorCode(FORM_SUBMISSION_ERROR);\n windowScrollTo({ left: 0, top: 0, behavior: 'smooth' });\n }\n };\n\n const tabTitle = (\n <div className=\"d-inline-flex flex-wrap align-items-center\">\n <Icon src={ChevronLeft} />\n <span className=\"ml-2\">{formatMessage(messages['sign.in'])}</span>\n </div>\n );\n\n if (props.status === TOKEN_STATE.PENDING && token) {\n props.validateToken(token);\n return (\n <Spinner animation=\"border\" variant=\"primary\" className=\"spinner--position-centered\" />\n );\n } else {\n return (\n <BaseContainer>\n <div>\n <Helmet>\n <title>\n {formatMessage(messages['reset.password.page.title'], { siteName: getSiteConfig().siteName })}\n </title>\n </Helmet>\n <Tabs activeKey=\"\" id=\"controlled-tab\" onSelect={(key) => navigate(updatePathWithQueryParams(key))}>\n <Tab title={tabTitle} eventKey={LOGIN_PAGE} />\n </Tabs>\n <div id=\"main-content\" className=\"main-content\">\n <div className=\"mw-xs\">\n <ResetPasswordFailure errorCode={errorCode} errorMsg={props.errorMsg} />\n <h4>{formatMessage(messages['reset.password'])}</h4>\n <p className=\"mb-4\">{formatMessage(messages['reset.password.page.instructions'])}</p>\n <Form id=\"set-reset-password-form\" name=\"set-reset-password-form\">\n <PasswordField\n name=\"newPassword\"\n value={newPassword}\n handleChange={(e) => setNewPassword(e.target.value)}\n handleBlur={handleOnBlur}\n handleFocus={handleOnFocus}\n errorMessage={formErrors.newPassword}\n floatingLabel={formatMessage(messages['new.password.label'])}\n />\n <PasswordField\n name=\"confirmPassword\"\n value={confirmPassword}\n handleChange={handleConfirmPasswordChange}\n handleFocus={handleOnFocus}\n errorMessage={formErrors.confirmPassword}\n showRequirements={false}\n floatingLabel={formatMessage(messages['confirm.password.label'])}\n />\n <StatefulButton\n id=\"submit-new-password\"\n name=\"submit-new-password\"\n type=\"submit\"\n variant=\"brand\"\n className=\"reset-password--button\"\n state={props.status}\n labels={{\n default: formatMessage(messages['reset.password']),\n pending: '',\n }}\n onClick={e => handleSubmit(e)}\n onMouseDown={(e) => e.preventDefault()}\n />\n </Form>\n </div>\n </div>\n </div>\n </BaseContainer>\n );\n }\n};\n\nResetPasswordPage.defaultProps = {\n status: null,\n token: null,\n errorMsg: null,\n};\n\nResetPasswordPage.propTypes = {\n resetPassword: PropTypes.func.isRequired,\n validateToken: PropTypes.func.isRequired,\n token: PropTypes.string,\n status: PropTypes.string,\n errorMsg: PropTypes.string,\n};\n\nexport default connect(\n resetPasswordResultSelector,\n {\n resetPassword,\n validateToken,\n },\n)(ResetPasswordPage);\n"]}
@@ -0,0 +1,2 @@
1
+ export default ResetPasswordSuccess;
2
+ declare function ResetPasswordSuccess(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useIntl } from '@openedx/frontend-base';
3
+ import { Alert } from '@openedx/paragon';
4
+ import messages from './messages';
5
+ const ResetPasswordSuccess = () => {
6
+ const { formatMessage } = useIntl();
7
+ return (_jsxs(Alert, { id: "reset-password-success", variant: "success", className: "mb-5", children: [_jsx(Alert.Heading, { children: formatMessage(messages['reset.password.success.heading']) }), _jsx("p", { children: formatMessage(messages['reset.password.success']) })] }));
8
+ };
9
+ export default ResetPasswordSuccess;
10
+ //# sourceMappingURL=ResetPasswordSuccess.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResetPasswordSuccess.js","sourceRoot":"","sources":["../../src/reset-password/ResetPasswordSuccess.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IAChC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,MAAC,KAAK,IAAC,EAAE,EAAC,wBAAwB,EAAC,OAAO,EAAC,SAAS,EAAC,SAAS,EAAC,MAAM,aACnE,KAAC,KAAK,CAAC,OAAO,cACX,aAAa,CAAC,QAAQ,CAAC,gCAAgC,CAAC,CAAC,GAC5C,EAChB,sBAAI,aAAa,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC,GAAK,IACpD,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import { useIntl } from '@openedx/frontend-base';\nimport { Alert } from '@openedx/paragon';\n\nimport messages from './messages';\n\nconst ResetPasswordSuccess = () => {\n const { formatMessage } = useIntl();\n\n return (\n <Alert id=\"reset-password-success\" variant=\"success\" className=\"mb-5\">\n <Alert.Heading>\n {formatMessage(messages['reset.password.success.heading'])}\n </Alert.Heading>\n <p>{formatMessage(messages['reset.password.success'])}</p>\n </Alert>\n );\n};\n\nexport default ResetPasswordSuccess;\n"]}
@@ -0,0 +1,56 @@
1
+ export const RESET_PASSWORD: AsyncActionType;
2
+ export const VALIDATE_TOKEN: AsyncActionType;
3
+ export const PASSWORD_RESET_FAILURE: "PASSWORD_RESET_FAILURE";
4
+ export function passwordResetFailure(errorCode: any): {
5
+ type: string;
6
+ payload: {
7
+ errorCode: any;
8
+ };
9
+ };
10
+ export function validateToken(token: any): {
11
+ type: string;
12
+ payload: {
13
+ token: any;
14
+ };
15
+ };
16
+ export function validateTokenBegin(): {
17
+ type: string;
18
+ };
19
+ export function validateTokenSuccess(tokenStatus: any, token: any): {
20
+ type: string;
21
+ payload: {
22
+ tokenStatus: any;
23
+ token: any;
24
+ };
25
+ };
26
+ export function validateTokenFailure(errorCode: any): {
27
+ type: string;
28
+ payload: {
29
+ errorCode: any;
30
+ };
31
+ };
32
+ export function resetPassword(formPayload: any, token: any, params: any): {
33
+ type: string;
34
+ payload: {
35
+ formPayload: any;
36
+ token: any;
37
+ params: any;
38
+ };
39
+ };
40
+ export function resetPasswordBegin(): {
41
+ type: string;
42
+ };
43
+ export function resetPasswordSuccess(data: any): {
44
+ type: string;
45
+ payload: {
46
+ data: any;
47
+ };
48
+ };
49
+ export function resetPasswordFailure(errorCode: any, errorMsg?: null): {
50
+ type: string;
51
+ payload: {
52
+ errorCode: any;
53
+ errorMsg: any;
54
+ };
55
+ };
56
+ import { AsyncActionType } from '../../data/utils';
@@ -1,50 +1,41 @@
1
1
  import { AsyncActionType } from '../../data/utils';
2
-
3
2
  export const RESET_PASSWORD = new AsyncActionType('RESET', 'PASSWORD');
4
3
  export const VALIDATE_TOKEN = new AsyncActionType('VALIDATE', 'TOKEN');
5
4
  export const PASSWORD_RESET_FAILURE = 'PASSWORD_RESET_FAILURE';
6
-
7
5
  export const passwordResetFailure = (errorCode) => ({
8
- type: PASSWORD_RESET_FAILURE,
9
- payload: { errorCode },
6
+ type: PASSWORD_RESET_FAILURE,
7
+ payload: { errorCode },
10
8
  });
11
-
12
9
  // Validate confirmation token
13
10
  export const validateToken = (token) => ({
14
- type: VALIDATE_TOKEN.BASE,
15
- payload: { token },
11
+ type: VALIDATE_TOKEN.BASE,
12
+ payload: { token },
16
13
  });
17
-
18
14
  export const validateTokenBegin = () => ({
19
- type: VALIDATE_TOKEN.BEGIN,
15
+ type: VALIDATE_TOKEN.BEGIN,
20
16
  });
21
-
22
17
  export const validateTokenSuccess = (tokenStatus, token) => ({
23
- type: VALIDATE_TOKEN.SUCCESS,
24
- payload: { tokenStatus, token },
18
+ type: VALIDATE_TOKEN.SUCCESS,
19
+ payload: { tokenStatus, token },
25
20
  });
26
-
27
21
  export const validateTokenFailure = errorCode => ({
28
- type: VALIDATE_TOKEN.FAILURE,
29
- payload: { errorCode },
22
+ type: VALIDATE_TOKEN.FAILURE,
23
+ payload: { errorCode },
30
24
  });
31
-
32
25
  // Reset Password
33
26
  export const resetPassword = (formPayload, token, params) => ({
34
- type: RESET_PASSWORD.BASE,
35
- payload: { formPayload, token, params },
27
+ type: RESET_PASSWORD.BASE,
28
+ payload: { formPayload, token, params },
36
29
  });
37
-
38
30
  export const resetPasswordBegin = () => ({
39
- type: RESET_PASSWORD.BEGIN,
31
+ type: RESET_PASSWORD.BEGIN,
40
32
  });
41
-
42
33
  export const resetPasswordSuccess = data => ({
43
- type: RESET_PASSWORD.SUCCESS,
44
- payload: { data },
34
+ type: RESET_PASSWORD.SUCCESS,
35
+ payload: { data },
45
36
  });
46
-
47
37
  export const resetPasswordFailure = (errorCode, errorMsg = null) => ({
48
- type: RESET_PASSWORD.FAILURE,
49
- payload: { errorCode, errorMsg: errorMsg ?? errorCode },
38
+ type: RESET_PASSWORD.FAILURE,
39
+ payload: { errorCode, errorMsg: errorMsg !== null && errorMsg !== void 0 ? errorMsg : errorCode },
50
40
  });
41
+ //# sourceMappingURL=actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/reset-password/data/actions.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,eAAe,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,eAAe,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAE/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAClD,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,EAAE,SAAS,EAAE;CACvB,CAAC,CAAC;AAEH,8BAA8B;AAC9B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACvC,IAAI,EAAE,cAAc,CAAC,IAAI;IACzB,OAAO,EAAE,EAAE,KAAK,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAA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export const RESET_PASSWORD = new AsyncActionType('RESET', 'PASSWORD');\nexport const VALIDATE_TOKEN = new AsyncActionType('VALIDATE', 'TOKEN');\nexport const PASSWORD_RESET_FAILURE = 'PASSWORD_RESET_FAILURE';\n\nexport const passwordResetFailure = (errorCode) => ({\n type: PASSWORD_RESET_FAILURE,\n payload: { errorCode },\n});\n\n// Validate confirmation token\nexport const validateToken = (token) => ({\n type: VALIDATE_TOKEN.BASE,\n payload: { token },\n});\n\nexport const validateTokenBegin = () => ({\n type: VALIDATE_TOKEN.BEGIN,\n});\n\nexport const validateTokenSuccess = (tokenStatus, token) => ({\n type: VALIDATE_TOKEN.SUCCESS,\n payload: { tokenStatus, token },\n});\n\nexport const validateTokenFailure = errorCode => ({\n type: VALIDATE_TOKEN.FAILURE,\n payload: { errorCode },\n});\n\n// Reset Password\nexport const resetPassword = (formPayload, token, params) => ({\n type: RESET_PASSWORD.BASE,\n payload: { formPayload, token, params },\n});\n\nexport const resetPasswordBegin = () => ({\n type: RESET_PASSWORD.BEGIN,\n});\n\nexport const resetPasswordSuccess = data => ({\n type: RESET_PASSWORD.SUCCESS,\n payload: { data },\n});\n\nexport const resetPasswordFailure = (errorCode, errorMsg = null) => ({\n type: RESET_PASSWORD.FAILURE,\n payload: { errorCode, errorMsg: errorMsg ?? errorCode },\n});\n"]}
@@ -0,0 +1,13 @@
1
+ export namespace TOKEN_STATE {
2
+ let PENDING: string;
3
+ let VALID: string;
4
+ }
5
+ export const FORM_SUBMISSION_ERROR: "form-submission-error";
6
+ export const PASSWORD_RESET_ERROR: "password-reset-error";
7
+ export const SUCCESS: "success";
8
+ export const PASSWORD_VALIDATION_ERROR: "password-validation-failure";
9
+ export namespace PASSWORD_RESET {
10
+ let INVALID_TOKEN: string;
11
+ let INTERNAL_SERVER_ERROR: string;
12
+ let FORBIDDEN_REQUEST: string;
13
+ }
@@ -1,16 +1,15 @@
1
1
  export const TOKEN_STATE = {
2
- PENDING: 'token-pending',
3
- VALID: 'token-valid',
2
+ PENDING: 'token-pending',
3
+ VALID: 'token-valid',
4
4
  };
5
-
6
5
  // password reset error codes
7
6
  export const FORM_SUBMISSION_ERROR = 'form-submission-error';
8
7
  export const PASSWORD_RESET_ERROR = 'password-reset-error';
9
8
  export const SUCCESS = 'success';
10
9
  export const PASSWORD_VALIDATION_ERROR = 'password-validation-failure';
11
-
12
10
  export const PASSWORD_RESET = {
13
- INVALID_TOKEN: 'invalid-token',
14
- INTERNAL_SERVER_ERROR: 'password-reset-internal-server-error',
15
- FORBIDDEN_REQUEST: 'password-reset-rate-limit-error',
11
+ INVALID_TOKEN: 'invalid-token',
12
+ INTERNAL_SERVER_ERROR: 'password-reset-internal-server-error',
13
+ FORBIDDEN_REQUEST: 'password-reset-rate-limit-error',
16
14
  };
15
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/reset-password/data/constants.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO,EAAE,eAAe;IACxB,KAAK,EAAE,aAAa;CACrB,CAAC;AAEF,6BAA6B;AAC7B,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAC7D,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAC3D,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AAEvE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,aAAa,EAAE,eAAe;IAC9B,qBAAqB,EAAE,sCAAsC;IAC7D,iBAAiB,EAAE,iCAAiC;CACrD,CAAC","sourcesContent":["export const TOKEN_STATE = {\n PENDING: 'token-pending',\n VALID: 'token-valid',\n};\n\n// password reset error codes\nexport const FORM_SUBMISSION_ERROR = 'form-submission-error';\nexport const PASSWORD_RESET_ERROR = 'password-reset-error';\nexport const SUCCESS = 'success';\nexport const PASSWORD_VALIDATION_ERROR = 'password-validation-failure';\n\nexport const PASSWORD_RESET = {\n INVALID_TOKEN: 'invalid-token',\n INTERNAL_SERVER_ERROR: 'password-reset-internal-server-error',\n FORBIDDEN_REQUEST: 'password-reset-rate-limit-error',\n};\n"]}
@@ -0,0 +1,19 @@
1
+ export namespace defaultState {
2
+ let status: string;
3
+ let token: null;
4
+ let errorMsg: null;
5
+ }
6
+ export default reducer;
7
+ declare function reducer(state?: {
8
+ status: string;
9
+ token: null;
10
+ errorMsg: null;
11
+ }, action?: null): {
12
+ status: string;
13
+ token: any;
14
+ errorMsg: null;
15
+ } | {
16
+ status: any;
17
+ errorMsg: any;
18
+ token: null;
19
+ };
@@ -0,0 +1,25 @@
1
+ import { PASSWORD_RESET_FAILURE, RESET_PASSWORD, VALIDATE_TOKEN } from './actions';
2
+ import { PASSWORD_RESET_ERROR, TOKEN_STATE } from './constants';
3
+ export const defaultState = {
4
+ status: TOKEN_STATE.PENDING,
5
+ token: null,
6
+ errorMsg: null,
7
+ };
8
+ const reducer = (state = defaultState, action = null) => {
9
+ switch (action.type) {
10
+ case VALIDATE_TOKEN.SUCCESS:
11
+ return Object.assign(Object.assign({}, state), { status: TOKEN_STATE.VALID, token: action.payload.token });
12
+ case PASSWORD_RESET_FAILURE:
13
+ return Object.assign(Object.assign({}, state), { status: PASSWORD_RESET_ERROR });
14
+ case RESET_PASSWORD.BEGIN:
15
+ return Object.assign(Object.assign({}, state), { status: 'pending' });
16
+ case RESET_PASSWORD.SUCCESS:
17
+ return Object.assign(Object.assign({}, state), { status: 'success' });
18
+ case RESET_PASSWORD.FAILURE:
19
+ return Object.assign(Object.assign({}, state), { status: action.payload.errorCode, errorMsg: action.payload.errorMsg });
20
+ default:
21
+ return state;
22
+ }
23
+ };
24
+ export default reducer;
25
+ //# sourceMappingURL=reducers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reducers.js","sourceRoot":"","sources":["../../../src/reset-password/data/reducers.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,WAAW,CAAC,OAAO;IAC3B,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,KAAK,GAAG,YAAY,EAAE,MAAM,GAAG,IAAI,EAAE,EAAE;IACtD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,cAAc,CAAC,OAAO;YACzB,uCACK,KAAK,KACR,MAAM,EAAE,WAAW,CAAC,KAAK,EACzB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,IAC3B;QACJ,KAAK,sBAAsB;YACzB,uCACK,KAAK,KACR,MAAM,EAAE,oBAAoB,IAC5B;QACJ,KAAK,cAAc,CAAC,KAAK;YACvB,uCACK,KAAK,KACR,MAAM,EAAE,SAAS,IACjB;QACJ,KAAK,cAAc,CAAC,OAAO;YACzB,uCACK,KAAK,KACR,MAAM,EAAE,SAAS,IACjB;QACJ,KAAK,cAAc,CAAC,OAAO;YACzB,uCACK,KAAK,KACR,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,EAChC,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,QAAQ,IACjC;QACJ;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { PASSWORD_RESET_FAILURE, RESET_PASSWORD, VALIDATE_TOKEN } from './actions';\nimport { PASSWORD_RESET_ERROR, TOKEN_STATE } from './constants';\n\nexport const defaultState = {\n status: TOKEN_STATE.PENDING,\n token: null,\n errorMsg: null,\n};\n\nconst reducer = (state = defaultState, action = null) => {\n switch (action.type) {\n case VALIDATE_TOKEN.SUCCESS:\n return {\n ...state,\n status: TOKEN_STATE.VALID,\n token: action.payload.token,\n };\n case PASSWORD_RESET_FAILURE:\n return {\n ...state,\n status: PASSWORD_RESET_ERROR,\n };\n case RESET_PASSWORD.BEGIN:\n return {\n ...state,\n status: 'pending',\n };\n case RESET_PASSWORD.SUCCESS:\n return {\n ...state,\n status: 'success',\n };\n case RESET_PASSWORD.FAILURE:\n return {\n ...state,\n status: action.payload.errorCode,\n errorMsg: action.payload.errorMsg,\n };\n default:\n return state;\n }\n};\n\nexport default reducer;\n"]}
@@ -0,0 +1,7 @@
1
+ export function handleValidateToken(action: any): Generator<import("redux-saga/effects").CallEffect<any> | import("redux-saga/effects").PutEffect<{
2
+ type: string;
3
+ }>, void, unknown>;
4
+ export function handleResetPassword(action: any): Generator<import("redux-saga/effects").CallEffect<any> | import("redux-saga/effects").PutEffect<{
5
+ type: string;
6
+ }>, void, unknown>;
7
+ export default function saga(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
@@ -0,0 +1,63 @@
1
+ import { logError, logInfo } from '@openedx/frontend-base';
2
+ import { call, put, takeEvery } from 'redux-saga/effects';
3
+ import { passwordResetFailure, RESET_PASSWORD, resetPasswordBegin, resetPasswordFailure, resetPasswordSuccess, VALIDATE_TOKEN, validateTokenBegin, validateTokenSuccess, } from './actions';
4
+ import { PASSWORD_RESET, PASSWORD_VALIDATION_ERROR } from './constants';
5
+ import { resetPassword, validateToken } from './service';
6
+ // Services
7
+ export function* handleValidateToken(action) {
8
+ var _a;
9
+ try {
10
+ yield put(validateTokenBegin());
11
+ const data = yield call(validateToken, action.payload.token);
12
+ const isValid = data.is_valid;
13
+ if (isValid) {
14
+ yield put(validateTokenSuccess(isValid, action.payload.token));
15
+ }
16
+ else {
17
+ yield put(passwordResetFailure(PASSWORD_RESET.INVALID_TOKEN));
18
+ }
19
+ }
20
+ catch (err) {
21
+ if (((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 429) {
22
+ yield put(passwordResetFailure(PASSWORD_RESET.FORBIDDEN_REQUEST));
23
+ logInfo(err);
24
+ }
25
+ else {
26
+ yield put(passwordResetFailure(PASSWORD_RESET.INTERNAL_SERVER_ERROR));
27
+ logError(err);
28
+ }
29
+ }
30
+ }
31
+ export function* handleResetPassword(action) {
32
+ var _a;
33
+ try {
34
+ yield put(resetPasswordBegin());
35
+ const data = yield call(resetPassword, action.payload.formPayload, action.payload.token, action.payload.params);
36
+ const resetStatus = data.reset_status;
37
+ const resetErrors = data.err_msg;
38
+ if (resetStatus) {
39
+ yield put(resetPasswordSuccess(resetStatus));
40
+ }
41
+ else if (data.token_invalid) {
42
+ yield put(passwordResetFailure(PASSWORD_RESET.INVALID_TOKEN));
43
+ }
44
+ else {
45
+ yield put(resetPasswordFailure(PASSWORD_VALIDATION_ERROR, resetErrors));
46
+ }
47
+ }
48
+ catch (err) {
49
+ if (((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 429) {
50
+ yield put(resetPasswordFailure(PASSWORD_RESET.FORBIDDEN_REQUEST));
51
+ logInfo(err);
52
+ }
53
+ else {
54
+ yield put(resetPasswordFailure(PASSWORD_RESET.INTERNAL_SERVER_ERROR));
55
+ logError(err);
56
+ }
57
+ }
58
+ }
59
+ export default function* saga() {
60
+ yield takeEvery(RESET_PASSWORD.BASE, handleResetPassword);
61
+ yield takeEvery(VALIDATE_TOKEN.BASE, handleValidateToken);
62
+ }
63
+ //# sourceMappingURL=sagas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sagas.js","sourceRoot":"","sources":["../../../src/reset-password/data/sagas.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EACl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saga/effects';\n\nimport {\n passwordResetFailure,\n RESET_PASSWORD,\n resetPasswordBegin,\n resetPasswordFailure,\n resetPasswordSuccess,\n VALIDATE_TOKEN,\n validateTokenBegin,\n validateTokenSuccess,\n} from './actions';\nimport { PASSWORD_RESET, PASSWORD_VALIDATION_ERROR } from './constants';\nimport { resetPassword, validateToken } from './service';\n\n// Services\nexport function* handleValidateToken(action) {\n try {\n yield put(validateTokenBegin());\n const data = yield call(validateToken, action.payload.token);\n const isValid = data.is_valid;\n if (isValid) {\n yield put(validateTokenSuccess(isValid, action.payload.token));\n } else {\n yield put(passwordResetFailure(PASSWORD_RESET.INVALID_TOKEN));\n }\n } catch (err) {\n if (err.response?.status === 429) {\n yield put(passwordResetFailure(PASSWORD_RESET.FORBIDDEN_REQUEST));\n logInfo(err);\n } else {\n yield put(passwordResetFailure(PASSWORD_RESET.INTERNAL_SERVER_ERROR));\n logError(err);\n }\n }\n}\n\nexport function* handleResetPassword(action) {\n try {\n yield put(resetPasswordBegin());\n const data = yield call(resetPassword, action.payload.formPayload, action.payload.token, action.payload.params);\n const resetStatus = data.reset_status;\n const resetErrors = data.err_msg;\n\n if (resetStatus) {\n yield put(resetPasswordSuccess(resetStatus));\n } else if (data.token_invalid) {\n yield put(passwordResetFailure(PASSWORD_RESET.INVALID_TOKEN));\n } else {\n yield put(resetPasswordFailure(PASSWORD_VALIDATION_ERROR, resetErrors));\n }\n } catch (err) {\n if (err.response?.status === 429) {\n yield put(resetPasswordFailure(PASSWORD_RESET.FORBIDDEN_REQUEST));\n logInfo(err);\n } else {\n yield put(resetPasswordFailure(PASSWORD_RESET.INTERNAL_SERVER_ERROR));\n logError(err);\n }\n }\n}\n\nexport default function* saga() {\n yield takeEvery(RESET_PASSWORD.BASE, handleResetPassword);\n yield takeEvery(VALIDATE_TOKEN.BASE, handleValidateToken);\n}\n"]}
@@ -0,0 +1,23 @@
1
+ export const storeName: "resetPassword";
2
+ export function resetPasswordSelector(state: any): any;
3
+ export const resetPasswordResultSelector: ((state: any) => any) & {
4
+ clearCache: () => void;
5
+ resultsCount: () => number;
6
+ resetResultsCount: () => void;
7
+ } & {
8
+ resultFunc: (resultFuncArgs_0: any) => any;
9
+ memoizedResultFunc: ((resultFuncArgs_0: any) => any) & {
10
+ clearCache: () => void;
11
+ resultsCount: () => number;
12
+ resetResultsCount: () => void;
13
+ };
14
+ lastResult: () => any;
15
+ dependencies: [(state: any) => any];
16
+ recomputations: () => number;
17
+ resetRecomputations: () => void;
18
+ dependencyRecomputations: () => number;
19
+ resetDependencyRecomputations: () => void;
20
+ } & {
21
+ argsMemoize: typeof import("reselect").weakMapMemoize;
22
+ memoize: typeof import("reselect").weakMapMemoize;
23
+ };
@@ -0,0 +1,5 @@
1
+ import { createSelector } from 'reselect';
2
+ export const storeName = 'resetPassword';
3
+ export const resetPasswordSelector = state => (Object.assign({}, state[storeName]));
4
+ export const resetPasswordResultSelector = createSelector(resetPasswordSelector, resetPassword => resetPassword);
5
+ //# sourceMappingURL=selectors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../../src/reset-password/data/selectors.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;AAEzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC,EAAE,CAAC,mBAAM,KAAK,CAAC,SAAS,CAAC,EAAG,CAAC;AAExE,MAAM,CAAC,MAAM,2BAA2B,GAAG,cAAc,CACvD,qBAAqB,EACrB,aAAa,CAAC,EAAE,CAAC,aAAa,CAC/B,CAAC","sourcesContent":["import { createSelector } from 'reselect';\n\nexport const storeName = 'resetPassword';\n\nexport const resetPasswordSelector = state => ({ ...state[storeName] });\n\nexport const resetPasswordResultSelector = createSelector(\n resetPasswordSelector,\n resetPassword => resetPassword,\n);\n"]}
@@ -0,0 +1,3 @@
1
+ export function validateToken(token: any): Promise<any>;
2
+ export function resetPassword(payload: any, token: any, queryParams: any): Promise<any>;
3
+ export function validatePassword(payload: any): Promise<string>;