@openedx/frontend-app-authn 1.0.0-alpha.5 → 1.0.0-alpha.7

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 (480) hide show
  1. package/dist/Main.d.ts +3 -0
  2. package/dist/Main.js +10 -0
  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/{src → dist}/app.scss +1 -1
  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/dist/common-components/EmbeddedRegistrationRoute.js +22 -0
  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 +58 -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 +47 -0
  75. package/dist/common-components/PasswordField.js +98 -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 +72 -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 +43 -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 +57 -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 +32 -0
  94. package/dist/common-components/UnAuthOnlyRoute.js.map +1 -0
  95. package/dist/common-components/components/ThirdPartyAuthContext.d.ts +31 -0
  96. package/dist/common-components/components/ThirdPartyAuthContext.js +84 -0
  97. package/dist/common-components/components/ThirdPartyAuthContext.js.map +1 -0
  98. package/dist/common-components/data/api.d.ts +6 -0
  99. package/dist/common-components/data/api.js +26 -0
  100. package/dist/common-components/data/api.js.map +1 -0
  101. package/dist/common-components/data/apiHook.d.ts +9 -0
  102. package/dist/common-components/data/apiHook.js +14 -0
  103. package/dist/common-components/data/apiHook.js.map +1 -0
  104. package/dist/common-components/data/queryKeys.d.ts +4 -0
  105. package/dist/common-components/data/queryKeys.js +6 -0
  106. package/dist/common-components/data/queryKeys.js.map +1 -0
  107. package/dist/common-components/index.d.ts +10 -0
  108. package/{src/common-components/index.jsx → dist/common-components/index.js} +1 -3
  109. package/dist/common-components/index.js.map +1 -0
  110. package/dist/common-components/messages.d.ts +113 -0
  111. package/dist/common-components/messages.js +126 -0
  112. package/dist/common-components/messages.js.map +1 -0
  113. package/dist/constants.d.ts +14 -0
  114. package/dist/constants.js +17 -0
  115. package/dist/constants.js.map +1 -0
  116. package/dist/data/constants.d.ts +16 -0
  117. package/{src → dist}/data/constants.js +4 -17
  118. package/dist/data/constants.js.map +1 -0
  119. package/dist/data/countries.d.ts +26 -0
  120. package/{src/data/countries.ts → dist/data/countries.js} +6 -9
  121. package/dist/data/countries.js.map +1 -0
  122. package/dist/data/oneTrust.d.ts +2 -0
  123. package/dist/data/oneTrust.js +3 -0
  124. package/dist/data/oneTrust.js.map +1 -0
  125. package/dist/data/utils/cookies.d.ts +1 -0
  126. package/dist/data/utils/cookies.js +12 -0
  127. package/dist/data/utils/cookies.js.map +1 -0
  128. package/dist/data/utils/dataUtils.d.ts +12 -0
  129. package/dist/data/utils/dataUtils.js +81 -0
  130. package/dist/data/utils/dataUtils.js.map +1 -0
  131. package/dist/data/utils/index.d.ts +2 -0
  132. package/dist/data/utils/index.js +3 -0
  133. package/dist/data/utils/index.js.map +1 -0
  134. package/dist/data/utils/useMobileResponsive.d.ts +7 -0
  135. package/dist/data/utils/useMobileResponsive.js +22 -0
  136. package/dist/data/utils/useMobileResponsive.js.map +1 -0
  137. package/dist/field-renderer/FieldRenderer.d.ts +34 -0
  138. package/dist/field-renderer/FieldRenderer.js +70 -0
  139. package/dist/field-renderer/FieldRenderer.js.map +1 -0
  140. package/dist/field-renderer/index.d.ts +1 -0
  141. package/{src/field-renderer/index.jsx → dist/field-renderer/index.js} +1 -0
  142. package/dist/field-renderer/index.js.map +1 -0
  143. package/dist/forgot-password/ForgotPasswordAlert.d.ts +16 -0
  144. package/dist/forgot-password/ForgotPasswordAlert.js +66 -0
  145. package/dist/forgot-password/ForgotPasswordAlert.js.map +1 -0
  146. package/dist/forgot-password/ForgotPasswordPage.d.ts +2 -0
  147. package/dist/forgot-password/ForgotPasswordPage.js +92 -0
  148. package/dist/forgot-password/ForgotPasswordPage.js.map +1 -0
  149. package/dist/forgot-password/data/api.d.ts +2 -0
  150. package/dist/forgot-password/data/api.js +25 -0
  151. package/dist/forgot-password/data/api.js.map +1 -0
  152. package/dist/forgot-password/data/apiHook.d.ts +16 -0
  153. package/dist/forgot-password/data/apiHook.js +26 -0
  154. package/dist/forgot-password/data/apiHook.js.map +1 -0
  155. package/dist/forgot-password/index.d.ts +1 -0
  156. package/dist/forgot-password/index.js +2 -0
  157. package/dist/forgot-password/index.js.map +1 -0
  158. package/dist/forgot-password/messages.d.ts +123 -0
  159. package/dist/forgot-password/messages.js +128 -0
  160. package/dist/forgot-password/messages.js.map +1 -0
  161. package/dist/i18n/index.d.ts +25 -0
  162. package/dist/i18n/index.js +26 -0
  163. package/dist/i18n/index.js.map +1 -0
  164. package/dist/index.js +4 -0
  165. package/dist/index.js.map +1 -0
  166. package/dist/login/AccountActivationMessage.d.ts +14 -0
  167. package/dist/login/AccountActivationMessage.js +49 -0
  168. package/dist/login/AccountActivationMessage.js.map +1 -0
  169. package/dist/login/ChangePasswordPrompt.d.ts +18 -0
  170. package/dist/login/ChangePasswordPrompt.js +51 -0
  171. package/dist/login/ChangePasswordPrompt.js.map +1 -0
  172. package/dist/login/LoginFailure.d.ts +25 -0
  173. package/dist/login/LoginFailure.js +109 -0
  174. package/dist/login/LoginFailure.js.map +1 -0
  175. package/dist/login/LoginPage.d.ts +12 -0
  176. package/dist/login/LoginPage.js +174 -0
  177. package/dist/login/LoginPage.js.map +1 -0
  178. package/dist/login/components/LoginContext.d.ts +21 -0
  179. package/dist/login/components/LoginContext.js +28 -0
  180. package/dist/login/components/LoginContext.js.map +1 -0
  181. package/dist/login/data/api.d.ts +2 -0
  182. package/dist/login/data/api.js +27 -0
  183. package/dist/login/data/api.js.map +1 -0
  184. package/dist/login/data/apiHook.d.ts +13 -0
  185. package/dist/login/data/apiHook.js +57 -0
  186. package/dist/login/data/apiHook.js.map +1 -0
  187. package/dist/login/data/constants.d.ts +17 -0
  188. package/{src → dist}/login/data/constants.js +4 -4
  189. package/dist/login/data/constants.js.map +1 -0
  190. package/dist/login/index.d.ts +1 -0
  191. package/dist/login/index.js +2 -0
  192. package/dist/login/index.js.map +1 -0
  193. package/dist/login/messages.d.ts +198 -0
  194. package/dist/login/messages.js +210 -0
  195. package/dist/login/messages.js.map +1 -0
  196. package/dist/logistration/Logistration.d.ts +5 -0
  197. package/dist/logistration/Logistration.js +80 -0
  198. package/dist/logistration/Logistration.js.map +1 -0
  199. package/dist/progressive-profiling/ProgressiveProfiling.d.ts +2 -0
  200. package/dist/progressive-profiling/ProgressiveProfiling.js +143 -0
  201. package/dist/progressive-profiling/ProgressiveProfiling.js.map +1 -0
  202. package/dist/progressive-profiling/ProgressiveProfilingPageModal.d.ts +13 -0
  203. package/dist/progressive-profiling/ProgressiveProfilingPageModal.js +31 -0
  204. package/dist/progressive-profiling/ProgressiveProfilingPageModal.js.map +1 -0
  205. package/dist/progressive-profiling/components/ProgressiveProfilingContext.d.ts +18 -0
  206. package/dist/progressive-profiling/components/ProgressiveProfilingContext.js +52 -0
  207. package/dist/progressive-profiling/components/ProgressiveProfilingContext.js.map +1 -0
  208. package/dist/progressive-profiling/data/api.d.ts +2 -0
  209. package/dist/progressive-profiling/data/api.js +22 -0
  210. package/dist/progressive-profiling/data/api.js.map +1 -0
  211. package/dist/progressive-profiling/data/apiHook.d.ts +10 -0
  212. package/dist/progressive-profiling/data/apiHook.js +36 -0
  213. package/dist/progressive-profiling/data/apiHook.js.map +1 -0
  214. package/dist/progressive-profiling/index.d.ts +2 -0
  215. package/{src → dist}/progressive-profiling/index.js +1 -3
  216. package/dist/progressive-profiling/index.js.map +1 -0
  217. package/dist/progressive-profiling/messages.d.ts +53 -0
  218. package/dist/progressive-profiling/messages.js +57 -0
  219. package/dist/progressive-profiling/messages.js.map +1 -0
  220. package/dist/register/RegistrationFields/CountryField/CountryField.d.ts +38 -0
  221. package/dist/register/RegistrationFields/CountryField/CountryField.js +93 -0
  222. package/dist/register/RegistrationFields/CountryField/CountryField.js.map +1 -0
  223. package/dist/register/RegistrationFields/CountryField/validator.d.ts +8 -0
  224. package/dist/register/RegistrationFields/CountryField/validator.js +29 -0
  225. package/dist/register/RegistrationFields/CountryField/validator.js.map +1 -0
  226. package/dist/register/RegistrationFields/EmailField/EmailField.d.ts +30 -0
  227. package/dist/register/RegistrationFields/EmailField/EmailField.js +88 -0
  228. package/dist/register/RegistrationFields/EmailField/EmailField.js.map +1 -0
  229. package/dist/register/RegistrationFields/EmailField/constants.d.ts +3 -0
  230. package/dist/register/RegistrationFields/EmailField/constants.js +130 -0
  231. package/dist/register/RegistrationFields/EmailField/constants.js.map +1 -0
  232. package/dist/register/RegistrationFields/EmailField/validator.d.ts +17 -0
  233. package/dist/register/RegistrationFields/EmailField/validator.js +107 -0
  234. package/dist/register/RegistrationFields/EmailField/validator.js.map +1 -0
  235. package/dist/register/RegistrationFields/HonorCodeField/HonorCode.d.ts +21 -0
  236. package/dist/register/RegistrationFields/HonorCodeField/HonorCode.js +40 -0
  237. package/dist/register/RegistrationFields/HonorCodeField/HonorCode.js.map +1 -0
  238. package/dist/register/RegistrationFields/NameField/NameField.d.ts +29 -0
  239. package/dist/register/RegistrationFields/NameField/NameField.js +59 -0
  240. package/dist/register/RegistrationFields/NameField/NameField.js.map +1 -0
  241. package/dist/register/RegistrationFields/NameField/validator.d.ts +6 -0
  242. package/dist/register/RegistrationFields/NameField/validator.js +23 -0
  243. package/dist/register/RegistrationFields/NameField/validator.js.map +1 -0
  244. package/dist/register/RegistrationFields/TermsOfServiceField/TermsOfService.d.ts +16 -0
  245. package/dist/register/RegistrationFields/TermsOfServiceField/TermsOfService.js +24 -0
  246. package/dist/register/RegistrationFields/TermsOfServiceField/TermsOfService.js.map +1 -0
  247. package/dist/register/RegistrationFields/UsernameField/UsernameField.d.ts +31 -0
  248. package/dist/register/RegistrationFields/UsernameField/UsernameField.js +119 -0
  249. package/dist/register/RegistrationFields/UsernameField/UsernameField.js.map +1 -0
  250. package/dist/register/RegistrationFields/UsernameField/validator.d.ts +4 -0
  251. package/dist/register/RegistrationFields/UsernameField/validator.js +15 -0
  252. package/dist/register/RegistrationFields/UsernameField/validator.js.map +1 -0
  253. package/dist/register/RegistrationFields/index.d.ts +6 -0
  254. package/{src → dist}/register/RegistrationFields/index.js +1 -0
  255. package/dist/register/RegistrationFields/index.js.map +1 -0
  256. package/dist/register/RegistrationPage.d.ts +18 -0
  257. package/dist/register/RegistrationPage.js +259 -0
  258. package/dist/register/RegistrationPage.js.map +1 -0
  259. package/dist/register/components/ConfigurableRegistrationForm.d.ts +37 -0
  260. package/dist/register/components/ConfigurableRegistrationForm.js +145 -0
  261. package/dist/register/components/ConfigurableRegistrationForm.js.map +1 -0
  262. package/dist/register/components/RegisterContext.d.ts +8 -0
  263. package/dist/register/components/RegisterContext.js +167 -0
  264. package/dist/register/components/RegisterContext.js.map +1 -0
  265. package/dist/register/components/RegistrationFailure.d.ts +19 -0
  266. package/dist/register/components/RegistrationFailure.js +60 -0
  267. package/dist/register/components/RegistrationFailure.js.map +1 -0
  268. package/dist/register/data/api.d.ts +9 -0
  269. package/dist/register/data/api.js +45 -0
  270. package/dist/register/data/api.js.map +1 -0
  271. package/dist/register/data/apiHook.d.ts +33 -0
  272. package/dist/register/data/apiHook.js +66 -0
  273. package/dist/register/data/apiHook.js.map +1 -0
  274. package/dist/register/data/constants.d.ts +11 -0
  275. package/{src → dist}/register/data/constants.js +5 -4
  276. package/dist/register/data/constants.js.map +1 -0
  277. package/dist/register/data/utils.d.ts +6 -0
  278. package/dist/register/data/utils.js +128 -0
  279. package/dist/register/data/utils.js.map +1 -0
  280. package/dist/register/index.d.ts +1 -0
  281. package/dist/register/index.js +2 -0
  282. package/dist/register/index.js.map +1 -0
  283. package/dist/register/messages.d.ts +203 -0
  284. package/dist/register/messages.js +215 -0
  285. package/dist/register/messages.js.map +1 -0
  286. package/dist/register/types.d.ts +74 -0
  287. package/dist/register/types.js +2 -0
  288. package/dist/register/types.js.map +1 -0
  289. package/dist/reset-password/ResetPasswordFailure.d.ts +15 -0
  290. package/dist/reset-password/ResetPasswordFailure.js +44 -0
  291. package/dist/reset-password/ResetPasswordFailure.js.map +1 -0
  292. package/dist/reset-password/ResetPasswordPage.d.ts +2 -0
  293. package/dist/reset-password/ResetPasswordPage.js +182 -0
  294. package/dist/reset-password/ResetPasswordPage.js.map +1 -0
  295. package/dist/reset-password/ResetPasswordSuccess.d.ts +2 -0
  296. package/dist/reset-password/ResetPasswordSuccess.js +10 -0
  297. package/dist/reset-password/ResetPasswordSuccess.js.map +1 -0
  298. package/dist/reset-password/data/api.d.ts +4 -0
  299. package/dist/reset-password/data/api.js +57 -0
  300. package/dist/reset-password/data/api.js.map +1 -0
  301. package/dist/reset-password/data/apiHook.d.ts +31 -0
  302. package/dist/reset-password/data/apiHook.js +74 -0
  303. package/dist/reset-password/data/apiHook.js.map +1 -0
  304. package/dist/reset-password/data/constants.d.ts +13 -0
  305. package/{src → dist}/reset-password/data/constants.js +6 -7
  306. package/dist/reset-password/data/constants.js.map +1 -0
  307. package/dist/reset-password/index.d.ts +1 -0
  308. package/dist/reset-password/index.js +2 -0
  309. package/dist/reset-password/index.js.map +1 -0
  310. package/dist/reset-password/messages.d.ts +83 -0
  311. package/dist/reset-password/messages.js +87 -0
  312. package/dist/reset-password/messages.js.map +1 -0
  313. package/dist/routes.d.ts +19 -0
  314. package/dist/routes.js +76 -0
  315. package/dist/routes.js.map +1 -0
  316. package/{src → dist}/sass/_registration.scss +8 -10
  317. package/dist/slots/LoginComponentSlot/index.d.ts +12 -0
  318. package/dist/slots/LoginComponentSlot/index.js +11 -0
  319. package/dist/slots/LoginComponentSlot/index.js.map +1 -0
  320. package/package.json +26 -15
  321. package/src/Main.tsx +0 -23
  322. package/src/__mocks__/file.js +0 -1
  323. package/src/__mocks__/svg.js +0 -1
  324. package/src/app.ts +0 -43
  325. package/src/base-container/components/default-layout/DefaultLayout.test.jsx +0 -48
  326. package/src/base-container/components/default-layout/LargeLayout.jsx +0 -42
  327. package/src/base-container/components/default-layout/MediumLayout.jsx +0 -49
  328. package/src/base-container/components/default-layout/SmallLayout.jsx +0 -37
  329. package/src/base-container/components/default-layout/messages.js +0 -16
  330. package/src/base-container/components/image-layout/ExtraSmallLayout.jsx +0 -31
  331. package/src/base-container/components/image-layout/LargeLayout.jsx +0 -32
  332. package/src/base-container/components/image-layout/MediumLayout.jsx +0 -32
  333. package/src/base-container/components/image-layout/SmallLayout.jsx +0 -31
  334. package/src/base-container/components/image-layout/messages.js +0 -16
  335. package/src/base-container/components/welcome-page-layout/LargeLayout.jsx +0 -46
  336. package/src/base-container/components/welcome-page-layout/MediumLayout.jsx +0 -49
  337. package/src/base-container/components/welcome-page-layout/SmallLayout.jsx +0 -38
  338. package/src/base-container/components/welcome-page-layout/messages.js +0 -21
  339. package/src/base-container/index.jsx +0 -70
  340. package/src/base-container/tests/BaseContainer.test.jsx +0 -44
  341. package/src/common-components/EmbeddedRegistrationRoute.jsx +0 -26
  342. package/src/common-components/EnterpriseSSO.jsx +0 -110
  343. package/src/common-components/FormGroup.jsx +0 -106
  344. package/src/common-components/InstitutionLogistration.jsx +0 -102
  345. package/src/common-components/NotFoundPage.jsx +0 -15
  346. package/src/common-components/PasswordField.jsx +0 -175
  347. package/src/common-components/RedirectLogistration.jsx +0 -94
  348. package/src/common-components/RegisterFaIcons.jsx +0 -8
  349. package/src/common-components/SocialAuthProviders.jsx +0 -75
  350. package/src/common-components/ThirdPartyAuth.jsx +0 -123
  351. package/src/common-components/ThirdPartyAuthAlert.jsx +0 -49
  352. package/src/common-components/UnAuthOnlyRoute.jsx +0 -41
  353. package/src/common-components/data/actions.js +0 -27
  354. package/src/common-components/data/reducers.js +0 -63
  355. package/src/common-components/data/sagas.js +0 -32
  356. package/src/common-components/data/selectors.js +0 -28
  357. package/src/common-components/data/service.js +0 -23
  358. package/src/common-components/data/tests/reducer.test.js +0 -82
  359. package/src/common-components/data/tests/sagas.test.js +0 -71
  360. package/src/common-components/messages.jsx +0 -127
  361. package/src/common-components/tests/EmbeddedRegistrationRoute.test.jsx +0 -76
  362. package/src/common-components/tests/FormField.test.jsx +0 -289
  363. package/src/common-components/tests/SocialAuthProviders.test.jsx +0 -75
  364. package/src/common-components/tests/ThirdPartyAuthAlert.test.jsx +0 -39
  365. package/src/common-components/tests/UnAuthOnlyRoute.test.jsx +0 -73
  366. package/src/common-components/tests/__snapshots__/SocialAuthProviders.test.jsx.snap +0 -156
  367. package/src/common-components/tests/__snapshots__/ThirdPartyAuthAlert.test.jsx.snap +0 -53
  368. package/src/constants.ts +0 -1
  369. package/src/data/configureStore.js +0 -33
  370. package/src/data/oneTrust.js +0 -3
  371. package/src/data/reducers.js +0 -36
  372. package/src/data/sagas.js +0 -19
  373. package/src/data/tests/cookies.test.js +0 -42
  374. package/src/data/tests/dataUtils.test.js +0 -19
  375. package/src/data/tests/reduxUtils.test.js +0 -14
  376. package/src/data/utils/cookies.js +0 -12
  377. package/src/data/utils/dataUtils.js +0 -81
  378. package/src/data/utils/index.js +0 -11
  379. package/src/data/utils/reduxUtils.js +0 -34
  380. package/src/data/utils/useMobileResponsive.js +0 -24
  381. package/src/field-renderer/FieldRenderer.jsx +0 -156
  382. package/src/field-renderer/tests/FieldRenderer.test.jsx +0 -201
  383. package/src/forgot-password/ForgotPasswordAlert.jsx +0 -97
  384. package/src/forgot-password/ForgotPasswordPage.jsx +0 -193
  385. package/src/forgot-password/data/actions.js +0 -32
  386. package/src/forgot-password/data/reducers.js +0 -58
  387. package/src/forgot-password/data/sagas.js +0 -35
  388. package/src/forgot-password/data/selectors.js +0 -10
  389. package/src/forgot-password/data/service.js +0 -21
  390. package/src/forgot-password/data/tests/reducers.test.js +0 -34
  391. package/src/forgot-password/data/tests/sagas.test.js +0 -67
  392. package/src/forgot-password/index.js +0 -5
  393. package/src/forgot-password/messages.js +0 -128
  394. package/src/forgot-password/tests/ForgotPasswordPage.test.jsx +0 -269
  395. package/src/i18n/index.js +0 -25
  396. package/src/login/AccountActivationMessage.jsx +0 -78
  397. package/src/login/ChangePasswordPrompt.jsx +0 -91
  398. package/src/login/LoginFailure.jsx +0 -231
  399. package/src/login/LoginPage.jsx +0 -368
  400. package/src/login/data/actions.js +0 -39
  401. package/src/login/data/reducers.js +0 -76
  402. package/src/login/data/sagas.js +0 -45
  403. package/src/login/data/service.js +0 -27
  404. package/src/login/data/tests/reducers.test.js +0 -155
  405. package/src/login/data/tests/sagas.test.js +0 -110
  406. package/src/login/index.js +0 -5
  407. package/src/login/messages.jsx +0 -211
  408. package/src/login/tests/AccountActivationMessage.test.jsx +0 -122
  409. package/src/login/tests/ChangePasswordPrompt.test.jsx +0 -75
  410. package/src/login/tests/LoginFailure.test.jsx +0 -323
  411. package/src/login/tests/LoginPage.test.jsx +0 -839
  412. package/src/logistration/Logistration.jsx +0 -189
  413. package/src/logistration/Logistration.test.jsx +0 -275
  414. package/src/progressive-profiling/ProgressiveProfiling.jsx +0 -313
  415. package/src/progressive-profiling/ProgressiveProfilingPageModal.jsx +0 -56
  416. package/src/progressive-profiling/data/actions.js +0 -22
  417. package/src/progressive-profiling/data/reducers.js +0 -38
  418. package/src/progressive-profiling/data/sagas.js +0 -24
  419. package/src/progressive-profiling/data/selectors.js +0 -14
  420. package/src/progressive-profiling/data/service.js +0 -17
  421. package/src/progressive-profiling/messages.jsx +0 -57
  422. package/src/progressive-profiling/tests/ProgressiveProfiling.test.jsx +0 -322
  423. package/src/register/RegistrationFields/CountryField/CountryField.jsx +0 -164
  424. package/src/register/RegistrationFields/CountryField/CountryField.test.jsx +0 -204
  425. package/src/register/RegistrationFields/CountryField/validator.js +0 -32
  426. package/src/register/RegistrationFields/EmailField/EmailField.jsx +0 -140
  427. package/src/register/RegistrationFields/EmailField/EmailField.test.jsx +0 -236
  428. package/src/register/RegistrationFields/EmailField/constants.js +0 -131
  429. package/src/register/RegistrationFields/EmailField/validator.js +0 -126
  430. package/src/register/RegistrationFields/EmailField/validator.test.js +0 -39
  431. package/src/register/RegistrationFields/HonorCodeField/HonorCode.jsx +0 -104
  432. package/src/register/RegistrationFields/HonorCodeField/HonorCode.test.jsx +0 -70
  433. package/src/register/RegistrationFields/NameField/NameField.jsx +0 -68
  434. package/src/register/RegistrationFields/NameField/NameField.test.jsx +0 -146
  435. package/src/register/RegistrationFields/NameField/validator.js +0 -22
  436. package/src/register/RegistrationFields/TermsOfServiceField/TermsOfService.jsx +0 -58
  437. package/src/register/RegistrationFields/TermsOfServiceField/TermsOfService.test.jsx +0 -55
  438. package/src/register/RegistrationFields/UsernameField/UsernameField.jsx +0 -162
  439. package/src/register/RegistrationFields/UsernameField/UsernameField.test.jsx +0 -319
  440. package/src/register/RegistrationFields/UsernameField/validator.js +0 -16
  441. package/src/register/RegistrationPage.jsx +0 -428
  442. package/src/register/RegistrationPage.test.jsx +0 -854
  443. package/src/register/components/ConfigurableRegistrationForm.jsx +0 -244
  444. package/src/register/components/RegistrationFailure.jsx +0 -80
  445. package/src/register/components/tests/ConfigurableRegistrationForm.test.jsx +0 -401
  446. package/src/register/components/tests/RegistrationFailure.test.jsx +0 -212
  447. package/src/register/components/tests/ThirdPartyAuth.test.jsx +0 -439
  448. package/src/register/data/actions.js +0 -85
  449. package/src/register/data/reducers.js +0 -140
  450. package/src/register/data/sagas.js +0 -58
  451. package/src/register/data/selectors.js +0 -34
  452. package/src/register/data/service.js +0 -45
  453. package/src/register/data/tests/reducers.test.js +0 -277
  454. package/src/register/data/tests/sagas.test.js +0 -239
  455. package/src/register/data/tests/utils.test.js +0 -98
  456. package/src/register/data/utils.js +0 -147
  457. package/src/register/index.js +0 -4
  458. package/src/register/messages.jsx +0 -206
  459. package/src/reset-password/ResetPasswordFailure.jsx +0 -55
  460. package/src/reset-password/ResetPasswordPage.jsx +0 -224
  461. package/src/reset-password/ResetPasswordSuccess.jsx +0 -19
  462. package/src/reset-password/data/actions.js +0 -50
  463. package/src/reset-password/data/reducers.js +0 -44
  464. package/src/reset-password/data/sagas.js +0 -67
  465. package/src/reset-password/data/selectors.js +0 -10
  466. package/src/reset-password/data/service.js +0 -61
  467. package/src/reset-password/data/tests/sagas.test.js +0 -185
  468. package/src/reset-password/index.js +0 -5
  469. package/src/reset-password/messages.js +0 -88
  470. package/src/reset-password/tests/ResetPasswordPage.test.jsx +0 -241
  471. package/src/routes.jsx +0 -79
  472. package/src/setupTest.js +0 -68
  473. /package/{src → dist}/base-container/components/image-layout/index.scss +0 -0
  474. /package/{src/index.ts → dist/index.d.ts} +0 -0
  475. /package/{src → dist}/sass/_base_component.scss +0 -0
  476. /package/{src → dist}/sass/_forgot_password.scss +0 -0
  477. /package/{src → dist}/sass/_login_page.scss +0 -0
  478. /package/{src → dist}/sass/_progressive_profiling_page.scss +0 -0
  479. /package/{src → dist}/sass/_reset_password.scss +0 -0
  480. /package/{src → dist}/sass/_style.scss +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoginFailure.js","sourceRoot":"","sources":["../../src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E,EAAC,qBAAqB,EAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,QAAQ,EAAC,IAAI,EAAE,KAAK,aAC3E,KAAC,KAAK,CAAC,OAAO,cAAE,aAAa,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC,GAAiB,EACrF,YAAY,IACP,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG;IACjC,OAAO,EAAE,EAAE;CACZ,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"]}
@@ -0,0 +1,12 @@
1
+ export default LoginPage;
2
+ declare function LoginPage({ institutionLogin, handleInstitutionLogin, }: {
3
+ institutionLogin: any;
4
+ handleInstitutionLogin: any;
5
+ }): import("react/jsx-runtime").JSX.Element | null;
6
+ declare namespace LoginPage {
7
+ namespace propTypes {
8
+ let institutionLogin: PropTypes.Validator<boolean>;
9
+ let handleInstitutionLogin: PropTypes.Validator<(...args: any[]) => any>;
10
+ }
11
+ }
12
+ import PropTypes from 'prop-types';
@@ -0,0 +1,174 @@
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, Fragment as _Fragment } from "react/jsx-runtime";
11
+ import { useEffect, useMemo, useState } from 'react';
12
+ import { fetchAuthenticatedUser, hydrateAuthenticatedUser, getSiteConfig, getUrlByRouteRole, sendPageEvent, sendTrackEvent, useIntl, } from '@openedx/frontend-base';
13
+ import { Form, StatefulButton } from '@openedx/paragon';
14
+ import PropTypes from 'prop-types';
15
+ import { Helmet } from 'react-helmet';
16
+ import Skeleton from 'react-loading-skeleton';
17
+ import { Link, useLocation } from 'react-router-dom';
18
+ import { FormGroup, InstitutionLogistration, PasswordField, RedirectLogistration, ThirdPartyAuthAlert, } from '../common-components';
19
+ import AccountActivationMessage from './AccountActivationMessage';
20
+ import { useThirdPartyAuthContext } from '../common-components/components/ThirdPartyAuthContext';
21
+ import { useThirdPartyAuthHook } from '../common-components/data/apiHook';
22
+ import EnterpriseSSO from '../common-components/EnterpriseSSO';
23
+ import ThirdPartyAuth from '../common-components/ThirdPartyAuth';
24
+ import { loginPath, resetPasswordRole } from '../constants';
25
+ import { PENDING_STATE } from '../data/constants';
26
+ import { getActivationStatus, getAllPossibleQueryParams, getTpaHint, getTpaProvider, updatePathWithQueryParams, } from '../data/utils';
27
+ import ResetPasswordSuccess from '../reset-password/ResetPasswordSuccess';
28
+ import { useLoginContext } from './components/LoginContext';
29
+ import { useLogin } from './data/apiHook';
30
+ import { INVALID_FORM, TPA_AUTHENTICATION_FAILURE } from './data/constants';
31
+ import LoginFailureMessage from './LoginFailure';
32
+ import messages from './messages';
33
+ const LoginPage = ({ institutionLogin, handleInstitutionLogin, }) => {
34
+ var _a, _b;
35
+ // Context for third-party auth
36
+ const { thirdPartyAuthApiStatus, thirdPartyAuthContext, setThirdPartyAuthContextBegin, setThirdPartyAuthContextSuccess, setThirdPartyAuthContextFailure, } = useThirdPartyAuthContext();
37
+ const location = useLocation();
38
+ const { formFields, setFormFields, errors, setErrors, } = useLoginContext();
39
+ // React Query for server state
40
+ const [loginResult, setLoginResult] = useState({ success: false, redirectUrl: '' });
41
+ const [errorCode, setErrorCode] = useState({
42
+ type: '',
43
+ count: 0,
44
+ context: {},
45
+ });
46
+ const { mutate: loginUser, isPending: isLoggingIn } = useLogin({
47
+ onSuccess: (data) => __awaiter(void 0, void 0, void 0, function* () {
48
+ const redirectUrl = localNextPath || data.redirectUrl || '';
49
+ if (redirectUrl.startsWith('/')) {
50
+ yield fetchAuthenticatedUser({ forceRefresh: true });
51
+ // Hydrate in the background — publishes AUTHENTICATED_USER_CHANGED after
52
+ // SPA navigation, so the header picks up the full user profile (avatar, etc.)
53
+ hydrateAuthenticatedUser();
54
+ }
55
+ setLoginResult({ success: true, redirectUrl });
56
+ }),
57
+ onError: (formattedError) => {
58
+ setErrorCode(prev => ({
59
+ type: formattedError.type,
60
+ count: prev.count + 1,
61
+ context: formattedError.context,
62
+ }));
63
+ },
64
+ });
65
+ const [showResetPasswordSuccessBanner, setShowResetPasswordSuccessBanner] = useState(((_a = location.state) === null || _a === void 0 ? void 0 : _a.showResetPasswordSuccessBanner) || null);
66
+ const { providers, currentProvider, secondaryProviders, finishAuthUrl, platformName, errorMessage: thirdPartyErrorMessage, } = thirdPartyAuthContext;
67
+ const { formatMessage } = useIntl();
68
+ const activationMsgType = getActivationStatus();
69
+ const queryParams = useMemo(() => getAllPossibleQueryParams(), []);
70
+ const localNextPath = ((_b = queryParams.next) === null || _b === void 0 ? void 0 : _b.startsWith('/')) ? queryParams.next : null;
71
+ const tpaHint = useMemo(() => getTpaHint(), []);
72
+ const params = Object.assign({}, queryParams);
73
+ if (tpaHint) {
74
+ params.tpa_hint = tpaHint;
75
+ }
76
+ const { data, isSuccess, error } = useThirdPartyAuthHook(loginPath, params);
77
+ useEffect(() => {
78
+ sendPageEvent('login_and_registration', 'login');
79
+ setThirdPartyAuthContextBegin();
80
+ }, []); // eslint-disable-line react-hooks/exhaustive-deps
81
+ // Sync third-party auth context data
82
+ useEffect(() => {
83
+ if (isSuccess && data) {
84
+ setThirdPartyAuthContextSuccess(data.fieldDescriptions, data.optionalFields, data.thirdPartyAuthContext);
85
+ }
86
+ if (error) {
87
+ setThirdPartyAuthContextFailure();
88
+ }
89
+ }, [tpaHint, queryParams, isSuccess, data, error,
90
+ setThirdPartyAuthContextSuccess, setThirdPartyAuthContextFailure]);
91
+ useEffect(() => {
92
+ if (thirdPartyErrorMessage) {
93
+ setErrorCode((prevState) => ({
94
+ type: TPA_AUTHENTICATION_FAILURE,
95
+ count: prevState.count + 1,
96
+ context: {
97
+ errorMessage: thirdPartyErrorMessage,
98
+ },
99
+ }));
100
+ }
101
+ }, [thirdPartyErrorMessage]);
102
+ const validateFormFields = (payload) => {
103
+ const { emailOrUsername, password, } = payload;
104
+ const fieldErrors = Object.assign({}, errors);
105
+ if (emailOrUsername === '') {
106
+ fieldErrors.emailOrUsername = formatMessage(messages['email.validation.message']);
107
+ }
108
+ else if (emailOrUsername.length < 2) {
109
+ fieldErrors.emailOrUsername = formatMessage(messages['username.or.email.format.validation.less.chars.message']);
110
+ }
111
+ if (password === '') {
112
+ fieldErrors.password = formatMessage(messages['password.validation.message']);
113
+ }
114
+ return Object.assign({}, fieldErrors);
115
+ };
116
+ const handleSubmit = (event) => {
117
+ event.preventDefault();
118
+ if (showResetPasswordSuccessBanner) {
119
+ setShowResetPasswordSuccessBanner(false);
120
+ }
121
+ const formData = Object.assign({}, formFields);
122
+ const validationErrors = validateFormFields(formData);
123
+ if (validationErrors.emailOrUsername || validationErrors.password) {
124
+ setErrors(validationErrors);
125
+ setErrorCode(prev => ({
126
+ type: INVALID_FORM,
127
+ count: prev.count + 1,
128
+ context: {},
129
+ }));
130
+ return;
131
+ }
132
+ // add query params to the payload
133
+ const payload = Object.assign({ email_or_username: formData.emailOrUsername, password: formData.password }, queryParams);
134
+ loginUser(payload);
135
+ };
136
+ const handleOnChange = (event) => {
137
+ const { name, value, } = event.target;
138
+ // Save to context for persistence across tab switches
139
+ setFormFields(prevState => (Object.assign(Object.assign({}, prevState), { [name]: value })));
140
+ };
141
+ const handleOnFocus = (event) => {
142
+ const { name } = event.target;
143
+ setErrors(prevErrors => (Object.assign(Object.assign({}, prevErrors), { [name]: '' })));
144
+ };
145
+ const trackForgotPasswordLinkClick = () => {
146
+ sendTrackEvent('edx.bi.password-reset_form.toggled', { category: 'user-engagement' });
147
+ };
148
+ const { provider, skipHintedLogin, } = getTpaProvider(tpaHint, providers, secondaryProviders);
149
+ if (tpaHint) {
150
+ if (thirdPartyAuthApiStatus === PENDING_STATE) {
151
+ return _jsx(Skeleton, { height: 36 });
152
+ }
153
+ if (skipHintedLogin) {
154
+ window.location.href = getSiteConfig().lmsBaseUrl + provider.loginUrl;
155
+ return null;
156
+ }
157
+ if (provider) {
158
+ return _jsx(EnterpriseSSO, { provider: provider });
159
+ }
160
+ }
161
+ if (institutionLogin) {
162
+ return (_jsx(InstitutionLogistration, { secondaryProviders: secondaryProviders, headingTitle: formatMessage(messages['institution.login.page.title']) }));
163
+ }
164
+ return (_jsxs(_Fragment, { children: [_jsx(Helmet, { children: _jsx("title", { children: formatMessage(messages['login.page.title'], { siteName: getSiteConfig().siteName }) }) }), _jsx(RedirectLogistration, { success: loginResult.success, redirectUrl: loginResult.redirectUrl, finishAuthUrl: finishAuthUrl }), _jsxs("div", { className: "mw-xs mt-3 mb-2", children: [_jsx(LoginFailureMessage, { errorCode: errorCode.type, errorCount: errorCode.count, context: errorCode.context }), _jsx(ThirdPartyAuthAlert, { currentProvider: currentProvider, platformName: platformName }), _jsx(AccountActivationMessage, { messageType: activationMsgType }), showResetPasswordSuccessBanner && _jsx(ResetPasswordSuccess, {}), _jsxs(Form, { id: "sign-in-form", name: "sign-in-form", children: [_jsx(FormGroup, { name: "emailOrUsername", value: formFields.emailOrUsername, autoComplete: "on", handleChange: handleOnChange, handleFocus: handleOnFocus, errorMessage: errors.emailOrUsername, floatingLabel: formatMessage(messages['login.user.identity.label']) }), _jsx(PasswordField, { name: "password", value: formFields.password, autoComplete: "off", showScreenReaderText: false, showRequirements: false, handleChange: handleOnChange, handleFocus: handleOnFocus, errorMessage: errors.password, floatingLabel: formatMessage(messages['login.password.label']) }), _jsx(StatefulButton, { name: "sign-in", id: "sign-in", type: "submit", variant: "brand", className: "login-button-width", state: (isLoggingIn ? PENDING_STATE : 'default'), labels: {
165
+ default: formatMessage(messages['sign.in.button']),
166
+ pending: 'pending',
167
+ }, onClick: handleSubmit, onMouseDown: (event) => event.preventDefault() }), _jsx(Link, { id: "forgot-password", name: "forgot-password", className: "btn btn-link font-weight-500 text-body", to: updatePathWithQueryParams(getUrlByRouteRole(resetPasswordRole)), onClick: trackForgotPasswordLinkClick, children: formatMessage(messages['forgot.password']) }), _jsx(ThirdPartyAuth, { currentProvider: currentProvider, providers: providers, secondaryProviders: secondaryProviders, handleInstitutionLogin: handleInstitutionLogin, thirdPartyAuthApiStatus: thirdPartyAuthApiStatus, isLoginPage: true })] })] })] }));
168
+ };
169
+ LoginPage.propTypes = {
170
+ institutionLogin: PropTypes.bool.isRequired,
171
+ handleInstitutionLogin: PropTypes.func.isRequired,
172
+ };
173
+ export default LoginPage;
174
+ //# sourceMappingURL=LoginPage.js.map
@@ -0,0 +1 @@
1
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AAS,EACd,EAAE,EAAC,SAAS,EACZ,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,OAAO,EACf,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,EAChD,MAAM,EAAE;oCACN,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;oCAClD,OAAO,EAAE,SAAS;iCACnB,EACD,OAAO,EAAE,YAAY,EACrB,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,GAC9C,EACF,KAAC,IAAI,IACH,EAAE,EAAC,iBAAiB,EACpB,IAAI,EAAC,iBAAiB,EACtB,SAAS,EAAC,wCAAwC,EAClD,EAAE,EAAE,yBAAyB,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC,EACnE,OAAO,EAAE,4BAA4B,YAEpC,aAAa,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,GACtC,EACP,KAAC,cAAc,IACb,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,EAAE,sBAAsB,EAC9C,uBAAuB,EAAE,uBAAuB,EAChD,WAAW,SACX,IACG,IACH,IACL,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,CAAC,SAAS,GAAG;IACpB,gBAAgB,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IAC3C,sBAAsB,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;CAClD,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { useEffect, useMemo, useState } from 'react';\n\nimport {\n fetchAuthenticatedUser, hydrateAuthenticatedUser, getSiteConfig, getUrlByRouteRole,\n sendPageEvent, sendTrackEvent, useIntl,\n} from '@openedx/frontend-base';\nimport { Form, StatefulButton } from '@openedx/paragon';\nimport PropTypes from 'prop-types';\nimport { Helmet } from 'react-helmet';\nimport Skeleton from 'react-loading-skeleton';\nimport { Link, useLocation } from 'react-router-dom';\n\nimport {\n FormGroup,\n InstitutionLogistration,\n PasswordField,\n RedirectLogistration,\n ThirdPartyAuthAlert,\n} from '../common-components';\nimport AccountActivationMessage from './AccountActivationMessage';\nimport { useThirdPartyAuthContext } from '../common-components/components/ThirdPartyAuthContext';\nimport { useThirdPartyAuthHook } from '../common-components/data/apiHook';\nimport EnterpriseSSO from '../common-components/EnterpriseSSO';\nimport ThirdPartyAuth from '../common-components/ThirdPartyAuth';\nimport { loginPath, resetPasswordRole } from '../constants';\nimport { PENDING_STATE } from '../data/constants';\nimport {\n getActivationStatus,\n getAllPossibleQueryParams,\n getTpaHint,\n getTpaProvider,\n updatePathWithQueryParams,\n} from '../data/utils';\nimport ResetPasswordSuccess from '../reset-password/ResetPasswordSuccess';\nimport { useLoginContext } from './components/LoginContext';\nimport { useLogin } from './data/apiHook';\nimport { INVALID_FORM, TPA_AUTHENTICATION_FAILURE } from './data/constants';\nimport LoginFailureMessage from './LoginFailure';\nimport messages from './messages';\n\nconst LoginPage = ({\n institutionLogin,\n handleInstitutionLogin,\n}) => {\n // Context for third-party auth\n const {\n thirdPartyAuthApiStatus,\n thirdPartyAuthContext,\n setThirdPartyAuthContextBegin,\n setThirdPartyAuthContextSuccess,\n setThirdPartyAuthContextFailure,\n } = useThirdPartyAuthContext();\n const location = useLocation();\n\n const {\n formFields,\n setFormFields,\n errors,\n setErrors,\n } = useLoginContext();\n\n // React Query for server state\n const [loginResult, setLoginResult] = useState({ success: false, redirectUrl: '' });\n const [errorCode, setErrorCode] = useState({\n type: '',\n count: 0,\n context: {},\n });\n const { mutate: loginUser, isPending: isLoggingIn } = useLogin({\n onSuccess: async (data) => {\n const redirectUrl = localNextPath || data.redirectUrl || '';\n if (redirectUrl.startsWith('/')) {\n await fetchAuthenticatedUser({ forceRefresh: true });\n // Hydrate in the background — publishes AUTHENTICATED_USER_CHANGED after\n // SPA navigation, so the header picks up the full user profile (avatar, etc.)\n hydrateAuthenticatedUser();\n }\n setLoginResult({ success: true, redirectUrl });\n },\n onError: (formattedError) => {\n setErrorCode(prev => ({\n type: formattedError.type,\n count: prev.count + 1,\n context: formattedError.context,\n }));\n },\n });\n\n const [showResetPasswordSuccessBanner,\n setShowResetPasswordSuccessBanner] = useState(location.state?.showResetPasswordSuccessBanner || null);\n const {\n providers,\n currentProvider,\n secondaryProviders,\n finishAuthUrl,\n platformName,\n errorMessage: thirdPartyErrorMessage,\n } = thirdPartyAuthContext;\n const { formatMessage } = useIntl();\n const activationMsgType = getActivationStatus();\n const queryParams = useMemo(() => getAllPossibleQueryParams(), []);\n const localNextPath = queryParams.next?.startsWith('/') ? queryParams.next : null;\n\n const tpaHint = useMemo(() => getTpaHint(), []);\n const params = { ...queryParams };\n if (tpaHint) {\n params.tpa_hint = tpaHint;\n }\n const { data, isSuccess, error } = useThirdPartyAuthHook(loginPath, params);\n\n useEffect(() => {\n sendPageEvent('login_and_registration', 'login');\n setThirdPartyAuthContextBegin();\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n // Sync third-party auth context data\n useEffect(() => {\n if (isSuccess && data) {\n setThirdPartyAuthContextSuccess(\n data.fieldDescriptions,\n data.optionalFields,\n data.thirdPartyAuthContext,\n );\n }\n if (error) {\n setThirdPartyAuthContextFailure();\n }\n }, [tpaHint, queryParams, isSuccess, data, error,\n setThirdPartyAuthContextSuccess, setThirdPartyAuthContextFailure]);\n\n useEffect(() => {\n if (thirdPartyErrorMessage) {\n setErrorCode((prevState) => ({\n type: TPA_AUTHENTICATION_FAILURE,\n count: prevState.count + 1,\n context: {\n errorMessage: thirdPartyErrorMessage,\n },\n }));\n }\n }, [thirdPartyErrorMessage]);\n\n const validateFormFields = (payload) => {\n const {\n emailOrUsername,\n password,\n } = payload;\n const fieldErrors = { ...errors };\n\n if (emailOrUsername === '') {\n fieldErrors.emailOrUsername = formatMessage(messages['email.validation.message']);\n } else if (emailOrUsername.length < 2) {\n fieldErrors.emailOrUsername = formatMessage(messages['username.or.email.format.validation.less.chars.message']);\n }\n if (password === '') {\n fieldErrors.password = formatMessage(messages['password.validation.message']);\n }\n\n return { ...fieldErrors };\n };\n\n const handleSubmit = (event) => {\n event.preventDefault();\n if (showResetPasswordSuccessBanner) {\n setShowResetPasswordSuccessBanner(false);\n }\n\n const formData = { ...formFields };\n const validationErrors = validateFormFields(formData);\n if (validationErrors.emailOrUsername || validationErrors.password) {\n setErrors(validationErrors);\n setErrorCode(prev => ({\n type: INVALID_FORM,\n count: prev.count + 1,\n context: {},\n }));\n return;\n }\n\n // add query params to the payload\n const payload = {\n email_or_username: formData.emailOrUsername,\n password: formData.password,\n ...queryParams,\n };\n loginUser(payload);\n };\n\n const handleOnChange = (event) => {\n const {\n name,\n value,\n } = event.target;\n // Save to context for persistence across tab switches\n setFormFields(prevState => ({\n ...prevState,\n [name]: value,\n }));\n };\n\n const handleOnFocus = (event) => {\n const { name } = event.target;\n setErrors(prevErrors => ({\n ...prevErrors,\n [name]: '',\n }));\n };\n const trackForgotPasswordLinkClick = () => {\n sendTrackEvent('edx.bi.password-reset_form.toggled', { category: 'user-engagement' });\n };\n\n const {\n provider,\n skipHintedLogin,\n } = getTpaProvider(tpaHint, providers, secondaryProviders);\n\n if (tpaHint) {\n if (thirdPartyAuthApiStatus === PENDING_STATE) {\n return <Skeleton height={36} />;\n }\n\n if (skipHintedLogin) {\n window.location.href = getSiteConfig().lmsBaseUrl + provider.loginUrl;\n return null;\n }\n\n if (provider) {\n return <EnterpriseSSO provider={provider} />;\n }\n }\n\n if (institutionLogin) {\n return (\n <InstitutionLogistration\n secondaryProviders={secondaryProviders}\n headingTitle={formatMessage(messages['institution.login.page.title'])}\n />\n );\n }\n return (\n <>\n <Helmet>\n <title>{formatMessage(messages['login.page.title'], { siteName: getSiteConfig().siteName })}</title>\n </Helmet>\n <RedirectLogistration\n success={loginResult.success}\n redirectUrl={loginResult.redirectUrl}\n finishAuthUrl={finishAuthUrl}\n />\n <div className=\"mw-xs mt-3 mb-2\">\n <LoginFailureMessage\n errorCode={errorCode.type}\n errorCount={errorCode.count}\n context={errorCode.context}\n />\n <ThirdPartyAuthAlert\n currentProvider={currentProvider}\n platformName={platformName}\n />\n <AccountActivationMessage\n messageType={activationMsgType}\n />\n {showResetPasswordSuccessBanner && <ResetPasswordSuccess />}\n <Form id=\"sign-in-form\" name=\"sign-in-form\">\n <FormGroup\n name=\"emailOrUsername\"\n value={formFields.emailOrUsername}\n autoComplete=\"on\"\n handleChange={handleOnChange}\n handleFocus={handleOnFocus}\n errorMessage={errors.emailOrUsername}\n floatingLabel={formatMessage(messages['login.user.identity.label'])}\n />\n <PasswordField\n name=\"password\"\n value={formFields.password}\n autoComplete=\"off\"\n showScreenReaderText={false}\n showRequirements={false}\n handleChange={handleOnChange}\n handleFocus={handleOnFocus}\n errorMessage={errors.password}\n floatingLabel={formatMessage(messages['login.password.label'])}\n />\n <StatefulButton\n name=\"sign-in\"\n id=\"sign-in\"\n type=\"submit\"\n variant=\"brand\"\n className=\"login-button-width\"\n state={(isLoggingIn ? PENDING_STATE : 'default')}\n labels={{\n default: formatMessage(messages['sign.in.button']),\n pending: 'pending',\n }}\n onClick={handleSubmit}\n onMouseDown={(event) => event.preventDefault()}\n />\n <Link\n id=\"forgot-password\"\n name=\"forgot-password\"\n className=\"btn btn-link font-weight-500 text-body\"\n to={updatePathWithQueryParams(getUrlByRouteRole(resetPasswordRole))}\n onClick={trackForgotPasswordLinkClick}\n >\n {formatMessage(messages['forgot.password'])}\n </Link>\n <ThirdPartyAuth\n currentProvider={currentProvider}\n providers={providers}\n secondaryProviders={secondaryProviders}\n handleInstitutionLogin={handleInstitutionLogin}\n thirdPartyAuthApiStatus={thirdPartyAuthApiStatus}\n isLoginPage\n />\n </Form>\n </div>\n </>\n );\n};\n\nLoginPage.propTypes = {\n institutionLogin: PropTypes.bool.isRequired,\n handleInstitutionLogin: PropTypes.func.isRequired,\n};\n\nexport default LoginPage;\n"]}
@@ -0,0 +1,21 @@
1
+ import { Dispatch, FC, ReactNode, SetStateAction } from 'react';
2
+ export interface FormFields {
3
+ emailOrUsername: string;
4
+ password: string;
5
+ }
6
+ export interface FormErrors {
7
+ emailOrUsername: string;
8
+ password: string;
9
+ }
10
+ interface LoginContextType {
11
+ formFields: FormFields;
12
+ setFormFields: Dispatch<SetStateAction<FormFields>>;
13
+ errors: FormErrors;
14
+ setErrors: Dispatch<SetStateAction<FormErrors>>;
15
+ }
16
+ interface LoginProviderProps {
17
+ children: ReactNode;
18
+ }
19
+ export declare const LoginProvider: FC<LoginProviderProps>;
20
+ export declare const useLoginContext: () => LoginContextType;
21
+ export {};
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useMemo, useState, } from 'react';
3
+ const LoginContext = createContext(undefined);
4
+ export const LoginProvider = ({ children }) => {
5
+ const [formFields, setFormFields] = useState({
6
+ emailOrUsername: '',
7
+ password: '',
8
+ });
9
+ const [errors, setErrors] = useState({
10
+ emailOrUsername: '',
11
+ password: '',
12
+ });
13
+ const contextValue = useMemo(() => ({
14
+ formFields,
15
+ setFormFields,
16
+ errors,
17
+ setErrors,
18
+ }), [formFields, errors]);
19
+ return (_jsx(LoginContext.Provider, { value: contextValue, children: children }));
20
+ };
21
+ export const useLoginContext = () => {
22
+ const context = useContext(LoginContext);
23
+ if (context === undefined) {
24
+ throw new Error('useLoginContext must be used within a LoginProvider');
25
+ }
26
+ return context;
27
+ };
28
+ //# sourceMappingURL=LoginContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoginContext.js","sourceRoot":"","sources":["../../../src/login/components/LoginContext.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EAA2C,UAAU,EAAE,OAAO,EAAE,QAAQ,GACtF,MAAM,OAAO,CAAC;AAmBf,MAAM,YAAY,GAAG,aAAa,CAA+B,SAAS,CAAC,CAAC;AAM5E,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC;QAC3C,eAAe,EAAE,EAAE;QACnB,QAAQ,EAAE,EAAE;KACb,CAAC,CAAC;IACH,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC;QACnC,eAAe,EAAE,EAAE;QACnB,QAAQ,EAAE,EAAE;KACb,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAClC,UAAU;QACV,aAAa;QACb,MAAM;QACN,SAAS;KACV,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;IAE1B,OAAO,CACL,KAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YACvC,QAAQ,GACa,CACzB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACzC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import {\n createContext, Dispatch, FC, ReactNode, SetStateAction, useContext, useMemo, useState,\n} from 'react';\n\nexport interface FormFields {\n emailOrUsername: string,\n password: string,\n}\n\nexport interface FormErrors {\n emailOrUsername: string,\n password: string,\n}\n\ninterface LoginContextType {\n formFields: FormFields,\n setFormFields: Dispatch<SetStateAction<FormFields>>,\n errors: FormErrors,\n setErrors: Dispatch<SetStateAction<FormErrors>>,\n}\n\nconst LoginContext = createContext<LoginContextType | undefined>(undefined);\n\ninterface LoginProviderProps {\n children: ReactNode,\n}\n\nexport const LoginProvider: FC<LoginProviderProps> = ({ children }) => {\n const [formFields, setFormFields] = useState({\n emailOrUsername: '',\n password: '',\n });\n const [errors, setErrors] = useState({\n emailOrUsername: '',\n password: '',\n });\n\n const contextValue = useMemo(() => ({\n formFields,\n setFormFields,\n errors,\n setErrors,\n }), [formFields, errors]);\n\n return (\n <LoginContext.Provider value={contextValue}>\n {children}\n </LoginContext.Provider>\n );\n};\n\nexport const useLoginContext = () => {\n const context = useContext(LoginContext);\n if (context === undefined) {\n throw new Error('useLoginContext must be used within a LoginProvider');\n }\n return context;\n};\n"]}
@@ -0,0 +1,2 @@
1
+ declare const login: (creds: any) => Promise<any>;
2
+ export { login, };
@@ -0,0 +1,27 @@
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 { camelCaseObject, getAuthenticatedHttpClient, getSiteConfig } from '@openedx/frontend-base';
11
+ import * as QueryString from 'query-string';
12
+ import { normalizeRedirectUrl } from '../../data/utils';
13
+ const login = (creds) => __awaiter(void 0, void 0, void 0, function* () {
14
+ const requestConfig = {
15
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
16
+ isPublic: true,
17
+ };
18
+ const url = `${getSiteConfig().lmsBaseUrl}/api/user/v2/account/login_session/`;
19
+ const { data } = yield getAuthenticatedHttpClient()
20
+ .post(url, QueryString.stringify(creds), requestConfig);
21
+ return camelCaseObject({
22
+ redirectUrl: normalizeRedirectUrl(data.redirect_url || ''),
23
+ success: data.success || false,
24
+ });
25
+ });
26
+ export { login, };
27
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/login/data/api.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACpG,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,KAAK,GAAG,CAAO,KAAK,EAAE,EAAE;IAC5B,MAAM,aAAa,GAAG;QACpB,OAAO,EAAE,EAAE,cAAc,EAAE,mCAAmC,EAAE;QAChE,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,MAAM,GAAG,GAAG,GAAG,aAAa,EAAE,CAAC,UAAU,qCAAqC,CAAC;IAC/E,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,0BAA0B,EAAE;SAChD,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC;IAC1D,OAAO,eAAe,CAAC;QACrB,WAAW,EAAE,oBAAoB,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC;QAC1D,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,KAAK;KAC/B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,OAAO,EACL,KAAK,GACN,CAAC","sourcesContent":["import { camelCaseObject, getAuthenticatedHttpClient, getSiteConfig } from '@openedx/frontend-base';\nimport * as QueryString from 'query-string';\n\nimport { normalizeRedirectUrl } from '../../data/utils';\n\nconst login = async (creds) => {\n const requestConfig = {\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n isPublic: true,\n };\n const url = `${getSiteConfig().lmsBaseUrl}/api/user/v2/account/login_session/`;\n const { data } = await getAuthenticatedHttpClient()\n .post(url, QueryString.stringify(creds), requestConfig);\n return camelCaseObject({\n redirectUrl: normalizeRedirectUrl(data.redirect_url || ''),\n success: data.success || false,\n });\n};\n\nexport {\n login,\n};\n"]}
@@ -0,0 +1,13 @@
1
+ interface LoginData {
2
+ email_or_username: string;
3
+ password: string;
4
+ }
5
+ interface LoginResponse {
6
+ redirectUrl?: string;
7
+ }
8
+ interface UseLoginOptions {
9
+ onSuccess?: (data: LoginResponse) => void;
10
+ onError?: (error: unknown) => void;
11
+ }
12
+ declare const useLogin: (options?: UseLoginOptions) => import("@tanstack/react-query").UseMutationResult<LoginResponse, unknown, LoginData, unknown>;
13
+ export { useLogin, };
@@ -0,0 +1,57 @@
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 { camelCaseObject, logError, logInfo } from '@openedx/frontend-base';
11
+ import { useMutation } from '@tanstack/react-query';
12
+ import { login } from './api';
13
+ import { FORBIDDEN_REQUEST, INTERNAL_SERVER_ERROR } from './constants';
14
+ const useLogin = (options = {}) => useMutation({
15
+ mutationFn: (loginData) => __awaiter(void 0, void 0, void 0, function* () { return login(loginData); }),
16
+ onSuccess: (data) => {
17
+ logInfo('Login successful', data);
18
+ if (options.onSuccess) {
19
+ options.onSuccess(data);
20
+ }
21
+ },
22
+ onError: (error) => {
23
+ var _a;
24
+ logError('Login failed', error);
25
+ let formattedError = {
26
+ type: INTERNAL_SERVER_ERROR,
27
+ context: {},
28
+ count: 0,
29
+ };
30
+ if (error && typeof error === 'object' && 'response' in error && error.response) {
31
+ const response = error.response;
32
+ const { status, data } = camelCaseObject(response);
33
+ if (data && typeof data === 'object') {
34
+ const errorData = data;
35
+ formattedError = {
36
+ type: errorData.errorCode || FORBIDDEN_REQUEST,
37
+ context: errorData.context || {},
38
+ count: ((_a = errorData.context) === null || _a === void 0 ? void 0 : _a.failureCount) || 0,
39
+ };
40
+ if (status === 400) {
41
+ logInfo('Login failed with validation error', error);
42
+ }
43
+ else if (status === 403) {
44
+ logInfo('Login failed with forbidden error', error);
45
+ }
46
+ else {
47
+ logError('Login failed with server error', error);
48
+ }
49
+ }
50
+ }
51
+ if (options.onError) {
52
+ options.onError(formattedError);
53
+ }
54
+ },
55
+ });
56
+ export { useLogin, };
57
+ //# sourceMappingURL=apiHook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiHook.js","sourceRoot":"","sources":["../../../src/login/data/apiHook.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAiBvE,MAAM,QAAQ,GAAG,CAAC,UAA2B,EAAE,EAAE,EAAE,CAAC,WAAW,CAAoC;IACjG,UAAU,EAAE,CAAO,SAAoB,EAAE,EAAE,kDAAC,OAAA,KAAK,CAAC,SAAS,CAA2B,CAAA,GAAA;IACtF,SAAS,EAAE,CAAC,IAAmB,EAAE,EAAE;QACjC,OAAO,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;QAClC,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;YACtB,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC,KAAc,EAAE,EAAE;;QAC1B,QAAQ,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QAChC,IAAI,cAAc,GAAG;YACnB,IAAI,EAAE,qBAAqB;YAC3B,OAAO,EAAE,EAAE;YACX,KAAK,EAAE,CAAC;SACT,CAAC;QACF,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,UAAU,IAAI,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YAChF,MAAM,QAAQ,GAAG,KAAK,CAAC,QAA+C,CAAC;YACvE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;YACnD,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACrC,MAAM,SAAS,GAAG,IAAmE,CAAC;gBACtF,cAAc,GAAG;oBACf,IAAI,EAAE,SAAS,CAAC,SAAS,IAAI,iBAAiB;oBAC9C,OAAO,EAAE,SAAS,CAAC,OAAO,IAAI,EAAE;oBAChC,KAAK,EAAE,CAAA,MAAA,SAAS,CAAC,OAAO,0CAAE,YAAY,KAAI,CAAC;iBAC5C,CAAC;gBACF,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnB,OAAO,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;gBACvD,CAAC;qBAAM,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;oBAC1B,OAAO,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;gBACtD,CAAC;qBAAM,CAAC;oBACN,QAAQ,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;gBACpD,CAAC;YACH,CAAC;QACH,CAAC;QACD,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AACH,OAAO,EACL,QAAQ,GACT,CAAC","sourcesContent":["import { camelCaseObject, logError, logInfo } from '@openedx/frontend-base';\nimport { useMutation } from '@tanstack/react-query';\n\nimport { login } from './api';\nimport { FORBIDDEN_REQUEST, INTERNAL_SERVER_ERROR } from './constants';\n\n// Type definitions\ninterface LoginData {\n email_or_username: string,\n password: string,\n}\n\ninterface LoginResponse {\n redirectUrl?: string,\n}\n\ninterface UseLoginOptions {\n onSuccess?: (data: LoginResponse) => void,\n onError?: (error: unknown) => void,\n}\n\nconst useLogin = (options: UseLoginOptions = {}) => useMutation<LoginResponse, unknown, LoginData>({\n mutationFn: async (loginData: LoginData) => login(loginData) as Promise<LoginResponse>,\n onSuccess: (data: LoginResponse) => {\n logInfo('Login successful', data);\n if (options.onSuccess) {\n options.onSuccess(data);\n }\n },\n onError: (error: unknown) => {\n logError('Login failed', error);\n let formattedError = {\n type: INTERNAL_SERVER_ERROR,\n context: {},\n count: 0,\n };\n if (error && typeof error === 'object' && 'response' in error && error.response) {\n const response = error.response as { status?: number, data?: unknown };\n const { status, data } = camelCaseObject(response);\n if (data && typeof data === 'object') {\n const errorData = data as { errorCode?: string, context?: { failureCount?: number } };\n formattedError = {\n type: errorData.errorCode || FORBIDDEN_REQUEST,\n context: errorData.context || {},\n count: errorData.context?.failureCount || 0,\n };\n if (status === 400) {\n logInfo('Login failed with validation error', error);\n } else if (status === 403) {\n logInfo('Login failed with forbidden error', error);\n } else {\n logError('Login failed with server error', error);\n }\n }\n }\n if (options.onError) {\n options.onError(formattedError);\n }\n },\n});\nexport {\n useLogin,\n};\n"]}
@@ -0,0 +1,17 @@
1
+ export const INACTIVE_USER: "inactive-user";
2
+ export const INTERNAL_SERVER_ERROR: "internal-server-error";
3
+ export const INVALID_FORM: "invalid-form";
4
+ export const NON_COMPLIANT_PASSWORD_EXCEPTION: "NonCompliantPasswordException";
5
+ export const FORBIDDEN_REQUEST: "forbidden-request";
6
+ export const FAILED_LOGIN_ATTEMPT: "failed-login-attempt";
7
+ export const ACCOUNT_LOCKED_OUT: "account-locked-out";
8
+ export const INCORRECT_EMAIL_PASSWORD: "incorrect-email-or-password";
9
+ export const NUDGE_PASSWORD_CHANGE: "nudge-password-change";
10
+ export const REQUIRE_PASSWORD_CHANGE: "require-password-change";
11
+ export const ALLOWED_DOMAIN_LOGIN_ERROR: "allowed-domain-login-error";
12
+ export const TPA_AUTHENTICATION_FAILURE: "tpa-authentication-failure";
13
+ export namespace ACCOUNT_ACTIVATION_MESSAGE {
14
+ let INFO: string;
15
+ let SUCCESS: string;
16
+ let ERROR: string;
17
+ }
@@ -11,10 +11,10 @@ export const NUDGE_PASSWORD_CHANGE = 'nudge-password-change';
11
11
  export const REQUIRE_PASSWORD_CHANGE = 'require-password-change';
12
12
  export const ALLOWED_DOMAIN_LOGIN_ERROR = 'allowed-domain-login-error';
13
13
  export const TPA_AUTHENTICATION_FAILURE = 'tpa-authentication-failure';
14
-
15
14
  // Account Activation Message
16
15
  export const ACCOUNT_ACTIVATION_MESSAGE = {
17
- INFO: 'info',
18
- SUCCESS: 'success',
19
- ERROR: 'error',
16
+ INFO: 'info',
17
+ SUCCESS: 'success',
18
+ ERROR: 'error',
20
19
  };
20
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/login/data/constants.js"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAC7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAC7D,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AAC3C,MAAM,CAAC,MAAM,gCAAgC,GAAG,+BAA+B,CAAC;AAChF,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AACrD,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAC3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AACvD,MAAM,CAAC,MAAM,wBAAwB,GAAG,6BAA6B,CAAC;AACtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAC7D,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAC;AACjE,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAC;AACvE,MAAM,CAAC,MAAM,0BAA0B,GAAG,4BAA4B,CAAC;AAEvE,6BAA6B;AAC7B,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACf,CAAC","sourcesContent":["// Login Error Codes\nexport const INACTIVE_USER = 'inactive-user';\nexport const INTERNAL_SERVER_ERROR = 'internal-server-error';\nexport const INVALID_FORM = 'invalid-form';\nexport const NON_COMPLIANT_PASSWORD_EXCEPTION = 'NonCompliantPasswordException';\nexport const FORBIDDEN_REQUEST = 'forbidden-request';\nexport const FAILED_LOGIN_ATTEMPT = 'failed-login-attempt';\nexport const ACCOUNT_LOCKED_OUT = 'account-locked-out';\nexport const INCORRECT_EMAIL_PASSWORD = 'incorrect-email-or-password';\nexport const NUDGE_PASSWORD_CHANGE = 'nudge-password-change';\nexport const REQUIRE_PASSWORD_CHANGE = 'require-password-change';\nexport const ALLOWED_DOMAIN_LOGIN_ERROR = 'allowed-domain-login-error';\nexport const TPA_AUTHENTICATION_FAILURE = 'tpa-authentication-failure';\n\n// Account Activation Message\nexport const ACCOUNT_ACTIVATION_MESSAGE = {\n INFO: 'info',\n SUCCESS: 'success',\n ERROR: 'error',\n};\n"]}
@@ -0,0 +1 @@
1
+ export { default as LoginPage } from "./LoginPage";
@@ -0,0 +1,2 @@
1
+ export { default as LoginPage } from './LoginPage';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/login/index.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { default as LoginPage } from './LoginPage';\n"]}