@openedx/frontend-app-authn 1.0.0-alpha.6 → 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 (254) hide show
  1. package/dist/Main.js +1 -3
  2. package/dist/Main.js.map +1 -1
  3. package/dist/common-components/EmbeddedRegistrationRoute.js +2 -2
  4. package/dist/common-components/EmbeddedRegistrationRoute.js.map +1 -1
  5. package/dist/common-components/EnterpriseSSO.js +6 -3
  6. package/dist/common-components/EnterpriseSSO.js.map +1 -1
  7. package/dist/common-components/PasswordField.d.ts +17 -9
  8. package/dist/common-components/PasswordField.js +10 -6
  9. package/dist/common-components/PasswordField.js.map +1 -1
  10. package/dist/common-components/RedirectLogistration.js +7 -3
  11. package/dist/common-components/RedirectLogistration.js.map +1 -1
  12. package/dist/common-components/SocialAuthProviders.d.ts +2 -2
  13. package/dist/common-components/SocialAuthProviders.js +5 -4
  14. package/dist/common-components/SocialAuthProviders.js.map +1 -1
  15. package/dist/common-components/ThirdPartyAuth.js +3 -2
  16. package/dist/common-components/ThirdPartyAuth.js.map +1 -1
  17. package/dist/common-components/ThirdPartyAuthAlert.d.ts +2 -2
  18. package/dist/common-components/ThirdPartyAuthAlert.js +4 -4
  19. package/dist/common-components/ThirdPartyAuthAlert.js.map +1 -1
  20. package/dist/common-components/UnAuthOnlyRoute.js +5 -4
  21. package/dist/common-components/UnAuthOnlyRoute.js.map +1 -1
  22. package/dist/common-components/components/ThirdPartyAuthContext.d.ts +31 -0
  23. package/dist/common-components/components/ThirdPartyAuthContext.js +84 -0
  24. package/dist/common-components/components/ThirdPartyAuthContext.js.map +1 -0
  25. package/dist/common-components/data/api.d.ts +6 -0
  26. package/dist/common-components/data/api.js +26 -0
  27. package/dist/common-components/data/api.js.map +1 -0
  28. package/dist/common-components/data/apiHook.d.ts +9 -0
  29. package/dist/common-components/data/apiHook.js +14 -0
  30. package/dist/common-components/data/apiHook.js.map +1 -0
  31. package/dist/common-components/data/queryKeys.d.ts +4 -0
  32. package/dist/common-components/data/queryKeys.js +6 -0
  33. package/dist/common-components/data/queryKeys.js.map +1 -0
  34. package/dist/common-components/index.d.ts +0 -3
  35. package/dist/common-components/index.js +0 -3
  36. package/dist/common-components/index.js.map +1 -1
  37. package/dist/constants.d.ts +13 -0
  38. package/dist/constants.js +15 -0
  39. package/dist/constants.js.map +1 -1
  40. package/dist/data/constants.d.ts +0 -8
  41. package/dist/data/constants.js +0 -9
  42. package/dist/data/constants.js.map +1 -1
  43. package/dist/data/utils/dataUtils.d.ts +1 -0
  44. package/dist/data/utils/dataUtils.js +14 -0
  45. package/dist/data/utils/dataUtils.js.map +1 -1
  46. package/dist/data/utils/index.d.ts +1 -2
  47. package/dist/data/utils/index.js +1 -2
  48. package/dist/data/utils/index.js.map +1 -1
  49. package/dist/forgot-password/ForgotPasswordPage.d.ts +2 -36
  50. package/dist/forgot-password/ForgotPasswordPage.js +45 -44
  51. package/dist/forgot-password/ForgotPasswordPage.js.map +1 -1
  52. package/dist/forgot-password/data/api.d.ts +2 -0
  53. package/dist/forgot-password/data/{service.js → api.js} +13 -14
  54. package/dist/forgot-password/data/api.js.map +1 -0
  55. package/dist/forgot-password/data/apiHook.d.ts +16 -0
  56. package/dist/forgot-password/data/apiHook.js +26 -0
  57. package/dist/forgot-password/data/apiHook.js.map +1 -0
  58. package/dist/forgot-password/index.d.ts +0 -4
  59. package/dist/forgot-password/index.js +0 -4
  60. package/dist/forgot-password/index.js.map +1 -1
  61. package/dist/forgot-password/messages.js +1 -1
  62. package/dist/forgot-password/messages.js.map +1 -1
  63. package/dist/login/ChangePasswordPrompt.js +11 -5
  64. package/dist/login/ChangePasswordPrompt.js.map +1 -1
  65. package/dist/login/LoginPage.d.ts +12 -10
  66. package/dist/login/LoginPage.js +85 -127
  67. package/dist/login/LoginPage.js.map +1 -1
  68. package/dist/login/components/LoginContext.d.ts +21 -0
  69. package/dist/login/components/LoginContext.js +28 -0
  70. package/dist/login/components/LoginContext.js.map +1 -0
  71. package/dist/login/data/api.d.ts +2 -0
  72. package/dist/login/data/api.js +27 -0
  73. package/dist/login/data/api.js.map +1 -0
  74. package/dist/login/data/apiHook.d.ts +13 -0
  75. package/dist/login/data/apiHook.js +57 -0
  76. package/dist/login/data/apiHook.js.map +1 -0
  77. package/dist/login/index.d.ts +0 -3
  78. package/dist/login/index.js +0 -3
  79. package/dist/login/index.js.map +1 -1
  80. package/dist/logistration/Logistration.d.ts +5 -32
  81. package/dist/logistration/Logistration.js +28 -54
  82. package/dist/logistration/Logistration.js.map +1 -1
  83. package/dist/progressive-profiling/ProgressiveProfiling.d.ts +2 -46
  84. package/dist/progressive-profiling/ProgressiveProfiling.js +47 -71
  85. package/dist/progressive-profiling/ProgressiveProfiling.js.map +1 -1
  86. package/dist/progressive-profiling/ProgressiveProfilingPageModal.js +8 -1
  87. package/dist/progressive-profiling/ProgressiveProfilingPageModal.js.map +1 -1
  88. package/dist/progressive-profiling/components/ProgressiveProfilingContext.d.ts +18 -0
  89. package/dist/progressive-profiling/components/ProgressiveProfilingContext.js +52 -0
  90. package/dist/progressive-profiling/components/ProgressiveProfilingContext.js.map +1 -0
  91. package/dist/progressive-profiling/data/api.d.ts +2 -0
  92. package/dist/progressive-profiling/data/{service.js → api.js} +11 -12
  93. package/dist/progressive-profiling/data/api.js.map +1 -0
  94. package/dist/progressive-profiling/data/apiHook.d.ts +10 -0
  95. package/dist/progressive-profiling/data/apiHook.js +36 -0
  96. package/dist/progressive-profiling/data/apiHook.js.map +1 -0
  97. package/dist/progressive-profiling/index.d.ts +0 -2
  98. package/dist/progressive-profiling/index.js +0 -2
  99. package/dist/progressive-profiling/index.js.map +1 -1
  100. package/dist/register/RegistrationFields/CountryField/CountryField.d.ts +1 -1
  101. package/dist/register/RegistrationFields/CountryField/CountryField.js +5 -7
  102. package/dist/register/RegistrationFields/CountryField/CountryField.js.map +1 -1
  103. package/dist/register/RegistrationFields/EmailField/EmailField.js +17 -9
  104. package/dist/register/RegistrationFields/EmailField/EmailField.js.map +1 -1
  105. package/dist/register/RegistrationFields/NameField/NameField.js +14 -7
  106. package/dist/register/RegistrationFields/NameField/NameField.js.map +1 -1
  107. package/dist/register/RegistrationFields/NameField/validator.d.ts +1 -0
  108. package/dist/register/RegistrationFields/NameField/validator.js +4 -0
  109. package/dist/register/RegistrationFields/NameField/validator.js.map +1 -1
  110. package/dist/register/RegistrationFields/UsernameField/UsernameField.js +20 -14
  111. package/dist/register/RegistrationFields/UsernameField/UsernameField.js.map +1 -1
  112. package/dist/register/RegistrationPage.d.ts +1 -1
  113. package/dist/register/RegistrationPage.js +102 -59
  114. package/dist/register/RegistrationPage.js.map +1 -1
  115. package/dist/register/components/RegisterContext.d.ts +8 -0
  116. package/dist/register/components/RegisterContext.js +167 -0
  117. package/dist/register/components/RegisterContext.js.map +1 -0
  118. package/dist/register/components/RegistrationFailure.js +4 -1
  119. package/dist/register/components/RegistrationFailure.js.map +1 -1
  120. package/dist/register/data/api.d.ts +9 -0
  121. package/dist/register/data/api.js +45 -0
  122. package/dist/register/data/api.js.map +1 -0
  123. package/dist/register/data/apiHook.d.ts +33 -0
  124. package/dist/register/data/apiHook.js +66 -0
  125. package/dist/register/data/apiHook.js.map +1 -0
  126. package/dist/register/data/constants.d.ts +1 -0
  127. package/dist/register/data/constants.js +1 -0
  128. package/dist/register/data/constants.js.map +1 -1
  129. package/dist/register/index.d.ts +0 -2
  130. package/dist/register/index.js +0 -3
  131. package/dist/register/index.js.map +1 -1
  132. package/dist/register/messages.d.ts +10 -0
  133. package/dist/register/messages.js +10 -0
  134. package/dist/register/messages.js.map +1 -1
  135. package/dist/register/types.d.ts +74 -0
  136. package/dist/register/types.js +2 -0
  137. package/dist/register/types.js.map +1 -0
  138. package/dist/reset-password/ResetPasswordPage.d.ts +2 -32
  139. package/dist/reset-password/ResetPasswordPage.js +90 -58
  140. package/dist/reset-password/ResetPasswordPage.js.map +1 -1
  141. package/dist/reset-password/data/api.d.ts +4 -0
  142. package/dist/reset-password/data/api.js +57 -0
  143. package/dist/reset-password/data/api.js.map +1 -0
  144. package/dist/reset-password/data/apiHook.d.ts +31 -0
  145. package/dist/reset-password/data/apiHook.js +74 -0
  146. package/dist/reset-password/data/apiHook.js.map +1 -0
  147. package/dist/reset-password/index.d.ts +0 -4
  148. package/dist/reset-password/index.js +0 -4
  149. package/dist/reset-password/index.js.map +1 -1
  150. package/dist/routes.d.ts +1 -0
  151. package/dist/routes.js +15 -14
  152. package/dist/routes.js.map +1 -1
  153. package/dist/sass/_registration.scss +8 -10
  154. package/dist/slots/LoginComponentSlot/index.d.ts +12 -0
  155. package/dist/slots/LoginComponentSlot/index.js +11 -0
  156. package/dist/slots/LoginComponentSlot/index.js.map +1 -0
  157. package/package.json +18 -14
  158. package/dist/common-components/data/actions.d.ts +0 -26
  159. package/dist/common-components/data/actions.js +0 -22
  160. package/dist/common-components/data/actions.js.map +0 -1
  161. package/dist/common-components/data/reducers.d.ts +0 -62
  162. package/dist/common-components/data/reducers.js +0 -39
  163. package/dist/common-components/data/reducers.js.map +0 -1
  164. package/dist/common-components/data/sagas.d.ts +0 -12
  165. package/dist/common-components/data/sagas.js +0 -21
  166. package/dist/common-components/data/sagas.js.map +0 -1
  167. package/dist/common-components/data/selectors.d.ts +0 -98
  168. package/dist/common-components/data/selectors.js +0 -11
  169. package/dist/common-components/data/selectors.js.map +0 -1
  170. package/dist/common-components/data/service.d.ts +0 -5
  171. package/dist/common-components/data/service.js +0 -31
  172. package/dist/common-components/data/service.js.map +0 -1
  173. package/dist/data/configureStore.d.ts +0 -3
  174. package/dist/data/configureStore.js +0 -24
  175. package/dist/data/configureStore.js.map +0 -1
  176. package/dist/data/reducers.d.ts +0 -254
  177. package/dist/data/reducers.js +0 -17
  178. package/dist/data/reducers.js.map +0 -1
  179. package/dist/data/sagas.d.ts +0 -1
  180. package/dist/data/sagas.js +0 -18
  181. package/dist/data/sagas.js.map +0 -1
  182. package/dist/data/utils/reduxUtils.d.ts +0 -15
  183. package/dist/data/utils/reduxUtils.js +0 -29
  184. package/dist/data/utils/reduxUtils.js.map +0 -1
  185. package/dist/forgot-password/data/actions.d.ts +0 -30
  186. package/dist/forgot-password/data/actions.js +0 -26
  187. package/dist/forgot-password/data/actions.js.map +0 -1
  188. package/dist/forgot-password/data/reducers.d.ts +0 -13
  189. package/dist/forgot-password/data/reducers.js +0 -46
  190. package/dist/forgot-password/data/reducers.js.map +0 -1
  191. package/dist/forgot-password/data/sagas.d.ts +0 -4
  192. package/dist/forgot-password/data/sagas.js +0 -28
  193. package/dist/forgot-password/data/sagas.js.map +0 -1
  194. package/dist/forgot-password/data/selectors.d.ts +0 -23
  195. package/dist/forgot-password/data/selectors.js +0 -5
  196. package/dist/forgot-password/data/selectors.js.map +0 -1
  197. package/dist/forgot-password/data/service.d.ts +0 -1
  198. package/dist/forgot-password/data/service.js.map +0 -1
  199. package/dist/login/data/actions.d.ts +0 -36
  200. package/dist/login/data/actions.js +0 -32
  201. package/dist/login/data/actions.js.map +0 -1
  202. package/dist/login/data/reducers.d.ts +0 -82
  203. package/dist/login/data/reducers.js +0 -44
  204. package/dist/login/data/reducers.js.map +0 -1
  205. package/dist/login/data/sagas.d.ts +0 -10
  206. package/dist/login/data/sagas.js +0 -34
  207. package/dist/login/data/sagas.js.map +0 -1
  208. package/dist/login/data/service.d.ts +0 -4
  209. package/dist/login/data/service.js +0 -32
  210. package/dist/login/data/service.js.map +0 -1
  211. package/dist/progressive-profiling/data/actions.d.ts +0 -19
  212. package/dist/progressive-profiling/data/actions.js +0 -18
  213. package/dist/progressive-profiling/data/actions.js.map +0 -1
  214. package/dist/progressive-profiling/data/reducers.d.ts +0 -22
  215. package/dist/progressive-profiling/data/reducers.js +0 -23
  216. package/dist/progressive-profiling/data/reducers.js.map +0 -1
  217. package/dist/progressive-profiling/data/sagas.d.ts +0 -4
  218. package/dist/progressive-profiling/data/sagas.js +0 -17
  219. package/dist/progressive-profiling/data/sagas.js.map +0 -1
  220. package/dist/progressive-profiling/data/selectors.d.ts +0 -39
  221. package/dist/progressive-profiling/data/selectors.js +0 -9
  222. package/dist/progressive-profiling/data/selectors.js.map +0 -1
  223. package/dist/progressive-profiling/data/service.d.ts +0 -1
  224. package/dist/progressive-profiling/data/service.js.map +0 -1
  225. package/dist/register/data/actions.d.ts +0 -80
  226. package/dist/register/data/actions.js +0 -69
  227. package/dist/register/data/actions.js.map +0 -1
  228. package/dist/register/data/reducers.d.ts +0 -237
  229. package/dist/register/data/reducers.js +0 -86
  230. package/dist/register/data/reducers.js.map +0 -1
  231. package/dist/register/data/sagas.d.ts +0 -19
  232. package/dist/register/data/sagas.js +0 -45
  233. package/dist/register/data/sagas.js.map +0 -1
  234. package/dist/register/data/selectors.d.ts +0 -26
  235. package/dist/register/data/selectors.js +0 -25
  236. package/dist/register/data/selectors.js.map +0 -1
  237. package/dist/register/data/service.d.ts +0 -8
  238. package/dist/register/data/service.js +0 -46
  239. package/dist/register/data/service.js.map +0 -1
  240. package/dist/reset-password/data/actions.d.ts +0 -56
  241. package/dist/reset-password/data/actions.js +0 -41
  242. package/dist/reset-password/data/actions.js.map +0 -1
  243. package/dist/reset-password/data/reducers.d.ts +0 -19
  244. package/dist/reset-password/data/reducers.js +0 -25
  245. package/dist/reset-password/data/reducers.js.map +0 -1
  246. package/dist/reset-password/data/sagas.d.ts +0 -7
  247. package/dist/reset-password/data/sagas.js +0 -63
  248. package/dist/reset-password/data/sagas.js.map +0 -1
  249. package/dist/reset-password/data/selectors.d.ts +0 -23
  250. package/dist/reset-password/data/selectors.js +0 -5
  251. package/dist/reset-password/data/selectors.js.map +0 -1
  252. package/dist/reset-password/data/service.d.ts +0 -3
  253. package/dist/reset-password/data/service.js +0 -62
  254. package/dist/reset-password/data/service.js.map +0 -1
@@ -0,0 +1,31 @@
1
+ import { FC, ReactNode } from 'react';
2
+ interface ThirdPartyAuthContextType {
3
+ fieldDescriptions: any;
4
+ optionalFields: {
5
+ fields: any;
6
+ extended_profile: any[];
7
+ };
8
+ thirdPartyAuthApiStatus: string | null;
9
+ thirdPartyAuthContext: {
10
+ platformName: string | null;
11
+ autoSubmitRegForm: boolean;
12
+ currentProvider: string | null;
13
+ finishAuthUrl: string | null;
14
+ countryCode: string | null;
15
+ providers: any[];
16
+ secondaryProviders: any[];
17
+ pipelineUserDetails: any | null;
18
+ errorMessage: string | null;
19
+ welcomePageRedirectUrl: string | null;
20
+ };
21
+ setThirdPartyAuthContextBegin: () => void;
22
+ setThirdPartyAuthContextSuccess: (fieldDescData: any, optionalFieldsData: any, contextData: any) => void;
23
+ setThirdPartyAuthContextFailure: () => void;
24
+ clearThirdPartyAuthErrorMessage: () => void;
25
+ }
26
+ interface ThirdPartyAuthProviderProps {
27
+ children: ReactNode;
28
+ }
29
+ export declare const ThirdPartyAuthProvider: FC<ThirdPartyAuthProviderProps>;
30
+ export declare const useThirdPartyAuthContext: () => ThirdPartyAuthContextType;
31
+ export {};
@@ -0,0 +1,84 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useCallback, useContext, useMemo, useState, } from 'react';
3
+ import { COMPLETE_STATE, FAILURE_STATE, PENDING_STATE } from '../../data/constants';
4
+ const ThirdPartyAuthContext = createContext(undefined);
5
+ export const ThirdPartyAuthProvider = ({ children }) => {
6
+ const [fieldDescriptions, setFieldDescriptions] = useState({});
7
+ const [optionalFields, setOptionalFields] = useState({
8
+ fields: {},
9
+ extended_profile: [],
10
+ });
11
+ const [thirdPartyAuthApiStatus, setThirdPartyAuthApiStatus] = useState(null);
12
+ const [thirdPartyAuthContext, setThirdPartyAuthContext] = useState({
13
+ platformName: null,
14
+ autoSubmitRegForm: false,
15
+ currentProvider: null,
16
+ finishAuthUrl: null,
17
+ countryCode: null,
18
+ providers: [],
19
+ secondaryProviders: [],
20
+ pipelineUserDetails: null,
21
+ errorMessage: null,
22
+ welcomePageRedirectUrl: null,
23
+ });
24
+ // Function to handle begin state - mirrors THIRD_PARTY_AUTH_CONTEXT.BEGIN
25
+ const setThirdPartyAuthContextBegin = useCallback(() => {
26
+ setThirdPartyAuthApiStatus(PENDING_STATE);
27
+ }, []);
28
+ // Function to handle success - mirrors THIRD_PARTY_AUTH_CONTEXT.SUCCESS
29
+ const setThirdPartyAuthContextSuccess = useCallback((fieldDescData, optionalFieldsData, contextData) => {
30
+ setFieldDescriptions((fieldDescData === null || fieldDescData === void 0 ? void 0 : fieldDescData.fields) || {});
31
+ setOptionalFields(optionalFieldsData || { fields: {}, extended_profile: [] });
32
+ setThirdPartyAuthContext(contextData || {
33
+ platformName: null,
34
+ autoSubmitRegForm: false,
35
+ currentProvider: null,
36
+ finishAuthUrl: null,
37
+ countryCode: null,
38
+ providers: [],
39
+ secondaryProviders: [],
40
+ pipelineUserDetails: null,
41
+ errorMessage: null,
42
+ welcomePageRedirectUrl: null,
43
+ });
44
+ setThirdPartyAuthApiStatus(COMPLETE_STATE);
45
+ }, []);
46
+ // Function to handle failure - mirrors THIRD_PARTY_AUTH_CONTEXT.FAILURE
47
+ const setThirdPartyAuthContextFailure = useCallback(() => {
48
+ setThirdPartyAuthApiStatus(FAILURE_STATE);
49
+ setThirdPartyAuthContext(prev => (Object.assign(Object.assign({}, prev), { errorMessage: null })));
50
+ }, []);
51
+ // Function to clear error message - mirrors THIRD_PARTY_AUTH_CONTEXT_CLEAR_ERROR_MSG
52
+ const clearThirdPartyAuthErrorMessage = useCallback(() => {
53
+ setThirdPartyAuthApiStatus(PENDING_STATE);
54
+ setThirdPartyAuthContext(prev => (Object.assign(Object.assign({}, prev), { errorMessage: null })));
55
+ }, []);
56
+ const value = useMemo(() => ({
57
+ fieldDescriptions,
58
+ optionalFields,
59
+ thirdPartyAuthApiStatus,
60
+ thirdPartyAuthContext,
61
+ setThirdPartyAuthContextBegin,
62
+ setThirdPartyAuthContextSuccess,
63
+ setThirdPartyAuthContextFailure,
64
+ clearThirdPartyAuthErrorMessage,
65
+ }), [
66
+ fieldDescriptions,
67
+ optionalFields,
68
+ thirdPartyAuthApiStatus,
69
+ thirdPartyAuthContext,
70
+ setThirdPartyAuthContextBegin,
71
+ setThirdPartyAuthContextSuccess,
72
+ setThirdPartyAuthContextFailure,
73
+ clearThirdPartyAuthErrorMessage,
74
+ ]);
75
+ return (_jsx(ThirdPartyAuthContext.Provider, { value: value, children: children }));
76
+ };
77
+ export const useThirdPartyAuthContext = () => {
78
+ const context = useContext(ThirdPartyAuthContext);
79
+ if (context === undefined) {
80
+ throw new Error('useThirdPartyAuthContext must be used within a ThirdPartyAuthProvider');
81
+ }
82
+ return context;
83
+ };
84
+ //# sourceMappingURL=ThirdPartyAuthContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThirdPartyAuthContext.js","sourceRoot":"","sources":["../../../src/common-components/components/ThirdPartyAuthContext.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EAAiB,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,GACzE,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AA2BpF,MAAM,qBAAqB,GAAG,aAAa,CAAwC,SAAS,CAAC,CAAC;AAM9F,MAAM,CAAC,MAAM,sBAAsB,GAAoC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtF,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC/D,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC;QACnD,MAAM,EAAE,EAAE;QACV,gBAAgB,EAAE,EAAE;KACrB,CAAC,CAAC;IACH,MAAM,CAAC,uBAAuB,EAAE,0BAA0B,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAC5F,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GAAG,QAAQ,CAAC;QACjE,YAAY,EAAE,IAAI;QAClB,iBAAiB,EAAE,KAAK;QACxB,eAAe,EAAE,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C,EAAE,EAAE,CAAC,CAAC;IAEP,qFAAqF;IACrF,MAAM,+BAA+B,GAAG,WAAW,CAAC,GAAG,EAAE;QACvD,0BAA0B,CAAC,aAAa,CAAC,CAAC;QAC1C,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC,iCAC5B,IAAI,KACP,YAAY,EAAE,IAAI,IAClB,CAAC,CAAC;IACN,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC3B,iBAAiB;QACjB,cAAc;QACd,uBAAuB;QACvB,qBAAqB;QACrB,6BAA6B;QAC7B,+BAA+B;QAC/B,+BAA+B;QAC/B,+BAA+B;KAChC,CAAC,EAAE;QACF,iBAAiB;QACjB,cAAc;QACd,uBAAuB;QACvB,qBAAqB;QACrB,6BAA6B;QAC7B,+BAA+B;QAC/B,+BAA+B;QAC/B,+BAA+B;KAChC,CAAC,CAAC;IAEH,OAAO,CACL,KAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACzC,QAAQ,GACsB,CAClC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAA8B,EAAE;IACtE,MAAM,OAAO,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAClD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import {\n createContext, FC, ReactNode, useCallback, useContext, useMemo, useState,\n} from 'react';\n\nimport { COMPLETE_STATE, FAILURE_STATE, PENDING_STATE } from '../../data/constants';\n\ninterface ThirdPartyAuthContextType {\n fieldDescriptions: any,\n optionalFields: {\n fields: any,\n extended_profile: any[],\n },\n thirdPartyAuthApiStatus: string | null,\n thirdPartyAuthContext: {\n platformName: string | null,\n autoSubmitRegForm: boolean,\n currentProvider: string | null,\n finishAuthUrl: string | null,\n countryCode: string | null,\n providers: any[],\n secondaryProviders: any[],\n pipelineUserDetails: any | null,\n errorMessage: string | null,\n welcomePageRedirectUrl: string | null,\n },\n setThirdPartyAuthContextBegin: () => void,\n setThirdPartyAuthContextSuccess: (fieldDescData: any, optionalFieldsData: any, contextData: any) => void,\n setThirdPartyAuthContextFailure: () => void,\n clearThirdPartyAuthErrorMessage: () => void,\n}\n\nconst ThirdPartyAuthContext = createContext<ThirdPartyAuthContextType | undefined>(undefined);\n\ninterface ThirdPartyAuthProviderProps {\n children: ReactNode,\n}\n\nexport const ThirdPartyAuthProvider: FC<ThirdPartyAuthProviderProps> = ({ children }) => {\n const [fieldDescriptions, setFieldDescriptions] = useState({});\n const [optionalFields, setOptionalFields] = useState({\n fields: {},\n extended_profile: [],\n });\n const [thirdPartyAuthApiStatus, setThirdPartyAuthApiStatus] = useState<string | null>(null);\n const [thirdPartyAuthContext, setThirdPartyAuthContext] = useState({\n platformName: null,\n autoSubmitRegForm: false,\n currentProvider: null,\n finishAuthUrl: null,\n countryCode: null,\n providers: [],\n secondaryProviders: [],\n pipelineUserDetails: null,\n errorMessage: null,\n welcomePageRedirectUrl: null,\n });\n\n // Function to handle begin state - mirrors THIRD_PARTY_AUTH_CONTEXT.BEGIN\n const setThirdPartyAuthContextBegin = useCallback(() => {\n setThirdPartyAuthApiStatus(PENDING_STATE);\n }, []);\n\n // Function to handle success - mirrors THIRD_PARTY_AUTH_CONTEXT.SUCCESS\n const setThirdPartyAuthContextSuccess = useCallback((fieldDescData, optionalFieldsData, contextData) => {\n setFieldDescriptions(fieldDescData?.fields || {});\n setOptionalFields(optionalFieldsData || { fields: {}, extended_profile: [] });\n setThirdPartyAuthContext(contextData || {\n platformName: null,\n autoSubmitRegForm: false,\n currentProvider: null,\n finishAuthUrl: null,\n countryCode: null,\n providers: [],\n secondaryProviders: [],\n pipelineUserDetails: null,\n errorMessage: null,\n welcomePageRedirectUrl: null,\n });\n setThirdPartyAuthApiStatus(COMPLETE_STATE);\n }, []);\n\n // Function to handle failure - mirrors THIRD_PARTY_AUTH_CONTEXT.FAILURE\n const setThirdPartyAuthContextFailure = useCallback(() => {\n setThirdPartyAuthApiStatus(FAILURE_STATE);\n setThirdPartyAuthContext(prev => ({\n ...prev,\n errorMessage: null,\n }));\n }, []);\n\n // Function to clear error message - mirrors THIRD_PARTY_AUTH_CONTEXT_CLEAR_ERROR_MSG\n const clearThirdPartyAuthErrorMessage = useCallback(() => {\n setThirdPartyAuthApiStatus(PENDING_STATE);\n setThirdPartyAuthContext(prev => ({\n ...prev,\n errorMessage: null,\n }));\n }, []);\n\n const value = useMemo(() => ({\n fieldDescriptions,\n optionalFields,\n thirdPartyAuthApiStatus,\n thirdPartyAuthContext,\n setThirdPartyAuthContextBegin,\n setThirdPartyAuthContextSuccess,\n setThirdPartyAuthContextFailure,\n clearThirdPartyAuthErrorMessage,\n }), [\n fieldDescriptions,\n optionalFields,\n thirdPartyAuthApiStatus,\n thirdPartyAuthContext,\n setThirdPartyAuthContextBegin,\n setThirdPartyAuthContextSuccess,\n setThirdPartyAuthContextFailure,\n clearThirdPartyAuthErrorMessage,\n ]);\n\n return (\n <ThirdPartyAuthContext.Provider value={value}>\n {children}\n </ThirdPartyAuthContext.Provider>\n );\n};\n\nexport const useThirdPartyAuthContext = (): ThirdPartyAuthContextType => {\n const context = useContext(ThirdPartyAuthContext);\n if (context === undefined) {\n throw new Error('useThirdPartyAuthContext must be used within a ThirdPartyAuthProvider');\n }\n return context;\n};\n"]}
@@ -0,0 +1,6 @@
1
+ declare const getThirdPartyAuthContext: (urlParams: string) => Promise<{
2
+ fieldDescriptions: any;
3
+ optionalFields: any;
4
+ thirdPartyAuthContext: any;
5
+ }>;
6
+ export { getThirdPartyAuthContext, };
@@ -0,0 +1,26 @@
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 { getAuthenticatedHttpClient, getSiteConfig } from '@openedx/frontend-base';
11
+ const getThirdPartyAuthContext = (urlParams) => __awaiter(void 0, void 0, void 0, function* () {
12
+ const requestConfig = {
13
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
14
+ params: urlParams,
15
+ isPublic: true,
16
+ };
17
+ const { data } = yield getAuthenticatedHttpClient()
18
+ .get(`${getSiteConfig().lmsBaseUrl}/api/mfe_context`, requestConfig);
19
+ return {
20
+ fieldDescriptions: data.registrationFields || {},
21
+ optionalFields: data.optionalFields || {},
22
+ thirdPartyAuthContext: data.contextData || {},
23
+ };
24
+ });
25
+ export { getThirdPartyAuthContext, };
26
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/common-components/data/api.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEnF,MAAM,wBAAwB,GAAG,CAAO,SAAiB,EAAE,EAAE;IAC3D,MAAM,aAAa,GAAG;QACpB,OAAO,EAAE,EAAE,cAAc,EAAE,mCAAmC,EAAE;QAChE,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,IAAI;KACf,CAAC;IAEF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,0BAA0B,EAAE;SAChD,GAAG,CACF,GAAG,aAAa,EAAE,CAAC,UAAU,kBAAkB,EAC/C,aAAa,CACd,CAAC;IACJ,OAAO;QACL,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,IAAI,EAAE;QAChD,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,EAAE;QACzC,qBAAqB,EAAE,IAAI,CAAC,WAAW,IAAI,EAAE;KAC9C,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,OAAO,EACL,wBAAwB,GACzB,CAAC","sourcesContent":["import { getAuthenticatedHttpClient, getSiteConfig } from '@openedx/frontend-base';\n\nconst getThirdPartyAuthContext = async (urlParams: string) => {\n const requestConfig = {\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n params: urlParams,\n isPublic: true,\n };\n\n const { data } = await getAuthenticatedHttpClient()\n .get(\n `${getSiteConfig().lmsBaseUrl}/api/mfe_context`,\n requestConfig,\n );\n return {\n fieldDescriptions: data.registrationFields || {},\n optionalFields: data.optionalFields || {},\n thirdPartyAuthContext: data.contextData || {},\n };\n};\n\nexport {\n getThirdPartyAuthContext,\n};\n"]}
@@ -0,0 +1,9 @@
1
+ export declare const THIRD_PARTY_AUTH_ERROR = "third-party-auth-error";
2
+ declare const useThirdPartyAuthHook: (pageId: any, payload: any, { enabled }?: {
3
+ enabled?: boolean | undefined;
4
+ }) => import("@tanstack/react-query").UseQueryResult<{
5
+ fieldDescriptions: any;
6
+ optionalFields: any;
7
+ thirdPartyAuthContext: any;
8
+ }, Error>;
9
+ export { useThirdPartyAuthHook, };
@@ -0,0 +1,14 @@
1
+ import { useQuery } from '@tanstack/react-query';
2
+ import { getThirdPartyAuthContext } from './api';
3
+ import { ThirdPartyAuthQueryKeys } from './queryKeys';
4
+ // Error constants
5
+ export const THIRD_PARTY_AUTH_ERROR = 'third-party-auth-error';
6
+ const useThirdPartyAuthHook = (pageId, payload, { enabled = true } = {}) => useQuery({
7
+ queryKey: ThirdPartyAuthQueryKeys.byPage(pageId, payload),
8
+ queryFn: () => getThirdPartyAuthContext(payload),
9
+ retry: false,
10
+ staleTime: 5 * 60 * 1000, // 5 minutes — TPA context is effectively static per session
11
+ enabled,
12
+ });
13
+ export { useThirdPartyAuthHook, };
14
+ //# sourceMappingURL=apiHook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiHook.js","sourceRoot":"","sources":["../../../src/common-components/data/apiHook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,kBAAkB;AAClB,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAE/D,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,GAAG,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC;IACnF,QAAQ,EAAE,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzD,OAAO,EAAE,GAAG,EAAE,CAAC,wBAAwB,CAAC,OAAO,CAAC;IAChD,KAAK,EAAE,KAAK;IACZ,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,4DAA4D;IACtF,OAAO;CACR,CAAC,CAAC;AAEH,OAAO,EACL,qBAAqB,GACtB,CAAC","sourcesContent":["import { useQuery } from '@tanstack/react-query';\n\nimport { getThirdPartyAuthContext } from './api';\nimport { ThirdPartyAuthQueryKeys } from './queryKeys';\n\n// Error constants\nexport const THIRD_PARTY_AUTH_ERROR = 'third-party-auth-error';\n\nconst useThirdPartyAuthHook = (pageId, payload, { enabled = true } = {}) => useQuery({\n queryKey: ThirdPartyAuthQueryKeys.byPage(pageId, payload),\n queryFn: () => getThirdPartyAuthContext(payload),\n retry: false,\n staleTime: 5 * 60 * 1000, // 5 minutes — TPA context is effectively static per session\n enabled,\n});\n\nexport {\n useThirdPartyAuthHook,\n};\n"]}
@@ -0,0 +1,4 @@
1
+ export declare const ThirdPartyAuthQueryKeys: {
2
+ all: readonly ["org.openedx.frontend.app.authn", "ThirdPartyAuth"];
3
+ byPage: (pageId: string, payload?: unknown) => readonly ["org.openedx.frontend.app.authn", "ThirdPartyAuth", string, unknown];
4
+ };
@@ -0,0 +1,6 @@
1
+ import { appId } from '../../constants';
2
+ export const ThirdPartyAuthQueryKeys = {
3
+ all: [appId, 'ThirdPartyAuth'],
4
+ byPage: (pageId, payload) => [appId, 'ThirdPartyAuth', pageId, payload],
5
+ };
6
+ //# sourceMappingURL=queryKeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryKeys.js","sourceRoot":"","sources":["../../../src/common-components/data/queryKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,GAAG,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAU;IACvC,MAAM,EAAE,CAAC,MAAc,EAAE,OAAiB,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAU;CACnG,CAAC","sourcesContent":["import { appId } from '../../constants';\n\nexport const ThirdPartyAuthQueryKeys = {\n all: [appId, 'ThirdPartyAuth'] as const,\n byPage: (pageId: string, payload?: unknown) => [appId, 'ThirdPartyAuth', pageId, payload] as const,\n};\n"]}
@@ -5,9 +5,6 @@ export { default as UnAuthOnlyRoute } from "./UnAuthOnlyRoute";
5
5
  export { default as NotFoundPage } from "./NotFoundPage";
6
6
  export { default as SocialAuthProviders } from "./SocialAuthProviders";
7
7
  export { default as ThirdPartyAuthAlert } from "./ThirdPartyAuthAlert";
8
- export { default as reducer } from "./data/reducers";
9
- export { default as saga } from "./data/sagas";
10
- export { storeName } from "./data/selectors";
11
8
  export { default as FormGroup } from "./FormGroup";
12
9
  export { default as PasswordField } from "./PasswordField";
13
10
  export { default as InstitutionLogistration, RenderInstitutionButton } from "./InstitutionLogistration";
@@ -7,9 +7,6 @@ export { default as SocialAuthProviders } from './SocialAuthProviders';
7
7
  export { default as ThirdPartyAuthAlert } from './ThirdPartyAuthAlert';
8
8
  export { default as InstitutionLogistration } from './InstitutionLogistration';
9
9
  export { RenderInstitutionButton } from './InstitutionLogistration';
10
- export { default as reducer } from './data/reducers';
11
- export { default as saga } from './data/sagas';
12
- export { storeName } from './data/selectors';
13
10
  export { default as FormGroup } from './FormGroup';
14
11
  export { default as PasswordField } from './PasswordField';
15
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common-components/index.jsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { default as RedirectLogistration } from './RedirectLogistration';\nexport { default as registerIcons } from './RegisterFaIcons';\nexport { default as EmbeddedRegistrationRoute } from './EmbeddedRegistrationRoute';\nexport { default as UnAuthOnlyRoute } from './UnAuthOnlyRoute';\nexport { default as NotFoundPage } from './NotFoundPage';\nexport { default as SocialAuthProviders } from './SocialAuthProviders';\nexport { default as ThirdPartyAuthAlert } from './ThirdPartyAuthAlert';\nexport { default as InstitutionLogistration } from './InstitutionLogistration';\nexport { RenderInstitutionButton } from './InstitutionLogistration';\nexport { default as reducer } from './data/reducers';\nexport { default as saga } from './data/sagas';\nexport { storeName } from './data/selectors';\nexport { default as FormGroup } from './FormGroup';\nexport { default as PasswordField } from './PasswordField';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common-components/index.jsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { default as RedirectLogistration } from './RedirectLogistration';\nexport { default as registerIcons } from './RegisterFaIcons';\nexport { default as EmbeddedRegistrationRoute } from './EmbeddedRegistrationRoute';\nexport { default as UnAuthOnlyRoute } from './UnAuthOnlyRoute';\nexport { default as NotFoundPage } from './NotFoundPage';\nexport { default as SocialAuthProviders } from './SocialAuthProviders';\nexport { default as ThirdPartyAuthAlert } from './ThirdPartyAuthAlert';\nexport { default as InstitutionLogistration } from './InstitutionLogistration';\nexport { RenderInstitutionButton } from './InstitutionLogistration';\nexport { default as FormGroup } from './FormGroup';\nexport { default as PasswordField } from './PasswordField';\n"]}
@@ -1 +1,14 @@
1
1
  export declare const appId = "org.openedx.frontend.app.authn";
2
+ export declare const loginRole = "org.openedx.frontend.role.login";
3
+ export declare const registerRole = "org.openedx.frontend.role.register";
4
+ export declare const resetPasswordRole = "org.openedx.frontend.role.resetPassword";
5
+ export declare const confirmPasswordRole = "org.openedx.frontend.role.confirmPassword";
6
+ export declare const welcomeRole = "org.openedx.frontend.role.welcome";
7
+ export declare const dashboardRole = "org.openedx.frontend.role.dashboard";
8
+ export declare const loginPath = "login";
9
+ export declare const registerPath = "register";
10
+ export declare const registerEmbeddedPath = "register-embedded";
11
+ export declare const resetPath = "reset";
12
+ export declare const welcomePath = "welcome";
13
+ export declare const passwordResetConfirmPath = "password_reset_confirm";
14
+ export declare const notFoundPath = "notfound";
package/dist/constants.js CHANGED
@@ -1,2 +1,17 @@
1
1
  export const appId = 'org.openedx.frontend.app.authn';
2
+ // Route roles
3
+ export const loginRole = 'org.openedx.frontend.role.login';
4
+ export const registerRole = 'org.openedx.frontend.role.register';
5
+ export const resetPasswordRole = 'org.openedx.frontend.role.resetPassword';
6
+ export const confirmPasswordRole = 'org.openedx.frontend.role.confirmPassword';
7
+ export const welcomeRole = 'org.openedx.frontend.role.welcome';
8
+ export const dashboardRole = 'org.openedx.frontend.role.dashboard';
9
+ // Route path segments
10
+ export const loginPath = 'login';
11
+ export const registerPath = 'register';
12
+ export const registerEmbeddedPath = 'register-embedded';
13
+ export const resetPath = 'reset';
14
+ export const welcomePath = 'welcome';
15
+ export const passwordResetConfirmPath = 'password_reset_confirm';
16
+ export const notFoundPath = 'notfound';
2
17
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,gCAAgC,CAAC","sourcesContent":["export const appId = 'org.openedx.frontend.app.authn';\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,gCAAgC,CAAC;AAEtD,cAAc;AACd,MAAM,CAAC,MAAM,SAAS,GAAG,iCAAiC,CAAC;AAC3D,MAAM,CAAC,MAAM,YAAY,GAAG,oCAAoC,CAAC;AACjE,MAAM,CAAC,MAAM,iBAAiB,GAAG,yCAAyC,CAAC;AAC3E,MAAM,CAAC,MAAM,mBAAmB,GAAG,2CAA2C,CAAC;AAC/E,MAAM,CAAC,MAAM,WAAW,GAAG,mCAAmC,CAAC;AAC/D,MAAM,CAAC,MAAM,aAAa,GAAG,qCAAqC,CAAC;AAEnE,sBAAsB;AACtB,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AACvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AACxD,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AACjC,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC;AACrC,MAAM,CAAC,MAAM,wBAAwB,GAAG,wBAAwB,CAAC;AACjE,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC","sourcesContent":["export const appId = 'org.openedx.frontend.app.authn';\n\n// Route roles\nexport const loginRole = 'org.openedx.frontend.role.login';\nexport const registerRole = 'org.openedx.frontend.role.register';\nexport const resetPasswordRole = 'org.openedx.frontend.role.resetPassword';\nexport const confirmPasswordRole = 'org.openedx.frontend.role.confirmPassword';\nexport const welcomeRole = 'org.openedx.frontend.role.welcome';\nexport const dashboardRole = 'org.openedx.frontend.role.dashboard';\n\n// Route path segments\nexport const loginPath = 'login';\nexport const registerPath = 'register';\nexport const registerEmbeddedPath = 'register-embedded';\nexport const resetPath = 'reset';\nexport const welcomePath = 'welcome';\nexport const passwordResetConfirmPath = 'password_reset_confirm';\nexport const notFoundPath = 'notfound';\n"]}
@@ -1,11 +1,3 @@
1
- export const LOGIN_PAGE: "/login";
2
- export const REGISTER_PAGE: "/register";
3
- export const REGISTER_EMBEDDED_PAGE: "/register-embedded";
4
- export const RESET_PAGE: "/reset";
5
- export const AUTHN_PROGRESSIVE_PROFILING: "/welcome";
6
- export const DEFAULT_REDIRECT_URL: "/dashboard";
7
- export const PASSWORD_RESET_CONFIRM: "/password_reset_confirm/:token/";
8
- export const PAGE_NOT_FOUND: "/notfound";
9
1
  export const ENTERPRISE_LOGIN_URL: "/enterprise/login";
10
2
  export const SUPPORTED_ICON_CLASSES: string[];
11
3
  export const FORM_SUBMISSION_ERROR: "form-submission-error";
@@ -1,12 +1,3 @@
1
- // URL Paths
2
- export const LOGIN_PAGE = '/login';
3
- export const REGISTER_PAGE = '/register';
4
- export const REGISTER_EMBEDDED_PAGE = '/register-embedded';
5
- export const RESET_PAGE = '/reset';
6
- export const AUTHN_PROGRESSIVE_PROFILING = '/welcome';
7
- export const DEFAULT_REDIRECT_URL = '/dashboard';
8
- export const PASSWORD_RESET_CONFIRM = '/password_reset_confirm/:token/';
9
- export const PAGE_NOT_FOUND = '/notfound';
10
1
  export const ENTERPRISE_LOGIN_URL = '/enterprise/login';
11
2
  // Constants
12
3
  export const SUPPORTED_ICON_CLASSES = ['apple', 'facebook', 'google', 'microsoft'];
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/data/constants.js"],"names":[],"mappings":"AAAA,YAA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FAAoF,CAAC;AAEzF,8DAA8D;AAC9D,2DAA2D;AAC3D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,WAAW,EAAE,mBAAmB,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACzM,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC","sourcesContent":["// URL Paths\nexport const LOGIN_PAGE = '/login';\nexport const REGISTER_PAGE = '/register';\nexport const REGISTER_EMBEDDED_PAGE = '/register-embedded';\nexport const RESET_PAGE = '/reset';\nexport const AUTHN_PROGRESSIVE_PROFILING = '/welcome';\nexport const DEFAULT_REDIRECT_URL = '/dashboard';\nexport const PASSWORD_RESET_CONFIRM = '/password_reset_confirm/:token/';\nexport const PAGE_NOT_FOUND = '/notfound';\nexport const ENTERPRISE_LOGIN_URL = '/enterprise/login';\n\n// Constants\nexport const SUPPORTED_ICON_CLASSES = ['apple', 'facebook', 'google', 'microsoft'];\n\n// Error Codes\nexport const FORM_SUBMISSION_ERROR = 'form-submission-error';\nexport const INTERNAL_SERVER_ERROR = 'internal-server-error';\nexport const API_RATELIMIT_ERROR = 'api-ratelimit-error';\n\n// Common States\nexport const DEFAULT_STATE = 'default';\nexport const PENDING_STATE = 'pending';\nexport const COMPLETE_STATE = 'complete';\nexport const FAILURE_STATE = 'failure';\nexport const FORBIDDEN_STATE = 'forbidden';\nexport const EMBEDDED = 'embedded';\n\nexport const LETTER_REGEX = /[a-zA-Z]/;\nexport const NUMBER_REGEX = /\\d/;\nexport const VALID_EMAIL_REGEX = '(^[-!#$%&\\'*+/=?^_`{}|~0-9A-Z]+(\\\\.[-!#$%&\\'*+/=?^_`{}|~0-9A-Z]+)*'\n + '|^\"([\\\\001-\\\\010\\\\013\\\\014\\\\016-\\\\037!#-\\\\[\\\\]-\\\\177]|\\\\\\\\[\\\\001-\\\\011\\\\013\\\\014\\\\016-\\\\177])*\"'\n + ')@((?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\\\\.)+)(?:[A-Z0-9-]{2,63})'\n + '|\\\\[(25[0-5]|2[0-4]\\\\d|[0-1]?\\\\d?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|[0-1]?\\\\d?\\\\d)){3}\\\\]$';\n\n// Query string parameters that can be passed to LMS to manage\n// things like auto-enrollment upon login and registration.\nexport const AUTH_PARAMS = ['course_id', 'enrollment_action', 'course_mode', 'email_opt_in', 'purchase_workflow', 'next', 'register_for_free', 'track', 'is_account_recovery', 'variant', 'host', 'cta'];\nexport const REDIRECT = 'redirect';\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/data/constants.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AAExD,YAAY;AACZ,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAEnF,cAAc;AACd,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAC7D,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAC7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAEzD,gBAAgB;AAChB,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AACvC,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AACvC,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AACzC,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AACvC,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAC3C,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;AAEnC,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AACvC,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AACjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,oEAAoE;MACjG,iGAAiG;MACjG,qEAAqE;MACrE,oFAAoF,CAAC;AAEzF,8DAA8D;AAC9D,2DAA2D;AAC3D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,WAAW,EAAE,mBAAmB,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACzM,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC","sourcesContent":["export const ENTERPRISE_LOGIN_URL = '/enterprise/login';\n\n// Constants\nexport const SUPPORTED_ICON_CLASSES = ['apple', 'facebook', 'google', 'microsoft'];\n\n// Error Codes\nexport const FORM_SUBMISSION_ERROR = 'form-submission-error';\nexport const INTERNAL_SERVER_ERROR = 'internal-server-error';\nexport const API_RATELIMIT_ERROR = 'api-ratelimit-error';\n\n// Common States\nexport const DEFAULT_STATE = 'default';\nexport const PENDING_STATE = 'pending';\nexport const COMPLETE_STATE = 'complete';\nexport const FAILURE_STATE = 'failure';\nexport const FORBIDDEN_STATE = 'forbidden';\nexport const EMBEDDED = 'embedded';\n\nexport const LETTER_REGEX = /[a-zA-Z]/;\nexport const NUMBER_REGEX = /\\d/;\nexport const VALID_EMAIL_REGEX = '(^[-!#$%&\\'*+/=?^_`{}|~0-9A-Z]+(\\\\.[-!#$%&\\'*+/=?^_`{}|~0-9A-Z]+)*'\n + '|^\"([\\\\001-\\\\010\\\\013\\\\014\\\\016-\\\\037!#-\\\\[\\\\]-\\\\177]|\\\\\\\\[\\\\001-\\\\011\\\\013\\\\014\\\\016-\\\\177])*\"'\n + ')@((?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\\\\.)+)(?:[A-Z0-9-]{2,63})'\n + '|\\\\[(25[0-5]|2[0-4]\\\\d|[0-1]?\\\\d?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|[0-1]?\\\\d?\\\\d)){3}\\\\]$';\n\n// Query string parameters that can be passed to LMS to manage\n// things like auto-enrollment upon login and registration.\nexport const AUTH_PARAMS = ['course_id', 'enrollment_action', 'course_mode', 'email_opt_in', 'purchase_workflow', 'next', 'register_for_free', 'track', 'is_account_recovery', 'variant', 'host', 'cta'];\nexport const REDIRECT = 'redirect';\n"]}
@@ -8,4 +8,5 @@ export function getAllPossibleQueryParams(locationURl?: null): {};
8
8
  export function getActivationStatus(): string | (string | null)[] | null;
9
9
  export function isScrollBehaviorSupported(): boolean;
10
10
  export function windowScrollTo(options: any): void;
11
+ export function normalizeRedirectUrl(backendUrl: any): any;
11
12
  export function isHostAvailableInQueryParams(): boolean;
@@ -1,5 +1,7 @@
1
1
  // Utility functions
2
+ import { getSiteConfig, getUrlByRouteRole } from '@openedx/frontend-base';
2
3
  import * as QueryString from 'query-string';
4
+ import { dashboardRole } from '../../constants';
3
5
  import { AUTH_PARAMS } from '../constants';
4
6
  export const getTpaProvider = (tpaHintProvider, primaryProviders, secondaryProviders) => {
5
7
  let tpaProvider = null;
@@ -60,6 +62,18 @@ export const windowScrollTo = (options) => {
60
62
  }
61
63
  return window.scrollTo(options.top, options.left);
62
64
  };
65
+ /**
66
+ * Normalize a backend redirect URL: if the backend returns the LMS dashboard
67
+ * URL (or nothing), replace it with the role-based dashboard URL so that SPA
68
+ * navigation can be used when the dashboard lives in the same shell.
69
+ */
70
+ export const normalizeRedirectUrl = (backendUrl) => {
71
+ const dashboardUrl = getUrlByRouteRole(dashboardRole) || '/';
72
+ const lmsDashboardUrl = `${getSiteConfig().lmsBaseUrl}/dashboard`;
73
+ return (!backendUrl || backendUrl.startsWith(lmsDashboardUrl))
74
+ ? dashboardUrl
75
+ : backendUrl;
76
+ };
63
77
  export const isHostAvailableInQueryParams = () => {
64
78
  const queryParams = getAllPossibleQueryParams();
65
79
  return 'host' in queryParams;
@@ -1 +1 @@
1
- {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CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEzD,OAAO,MAAM,CAAC,yBAAyB,CAAC;AAC1C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE,CAAC,gBAAgB,IAAI,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC;AAElG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,EAAE;IACxC,IAAI,yBAAyB,EAAE,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,EAAE;IAC/C,MAAM,WAAW,GAAG,yBAAyB,EAAE,CAAC;IAChD,OAAO,MAAM,IAAI,WAAW,CAAC;AAC/B,CAAC,CAAC","sourcesContent":["// Utility functions\nimport * as QueryString from 'query-string';\n\nimport { AUTH_PARAMS } from '../constants';\n\nexport const getTpaProvider = (tpaHintProvider, primaryProviders, secondaryProviders) => {\n let tpaProvider = null;\n let skipHintedLogin = false;\n [...primaryProviders, ...secondaryProviders].forEach((provider) => {\n if (provider.id === tpaHintProvider) {\n tpaProvider = provider;\n if (provider.skipHintedLogin) {\n skipHintedLogin = true;\n }\n }\n });\n return { provider: tpaProvider, skipHintedLogin };\n};\n\nexport const getTpaHint = () => {\n const params = QueryString.parse(window.location.search);\n let tpaHint = null;\n tpaHint = params.tpa_hint;\n if (!tpaHint) {\n const { next } = params;\n if (next) {\n const index = next.indexOf('tpa_hint=');\n if (index !== -1) {\n tpaHint = next.substring(index + 'tpa_hint='.length, next.length);\n }\n }\n }\n return tpaHint;\n};\n\nexport const updatePathWithQueryParams = (path) => {\n let queryParams = window.location.search;\n\n if (!queryParams) {\n return path;\n }\n\n if (queryParams.includes('track=pwreset')) {\n queryParams = queryParams.replace('?track=pwreset&', '?',).replace('?track=pwreset', '').replace('&track=pwreset', '').replace('?&', '?');\n }\n\n return `${path}${queryParams}`;\n};\n\nexport const getAllPossibleQueryParams = (locationURl = null) => {\n const urlParams = locationURl ? QueryString.parseUrl(locationURl).query : QueryString.parse(window.location.search);\n const params = {};\n Object.entries(urlParams).forEach(([key, value]) => {\n if (AUTH_PARAMS.includes(key)) {\n params[key] = value;\n }\n });\n\n return params;\n};\n\nexport const getActivationStatus = () => {\n const params = QueryString.parse(window.location.search);\n\n return params.account_activation_status;\n};\n\nexport const isScrollBehaviorSupported = () => 'scrollBehavior' in document.documentElement.style;\n\nexport const windowScrollTo = (options) => {\n if (isScrollBehaviorSupported()) {\n return window.scrollTo(options);\n }\n\n return window.scrollTo(options.top, options.left);\n};\n\nexport const isHostAvailableInQueryParams = () => {\n const queryParams = getAllPossibleQueryParams();\n return 'host' in queryParams;\n};\n"]}
1
+ {"version":3,"file":"dataUtils.js","sourceRoot":"","sources":["../../../src/data/utils/dataUtils.js"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,WAAW,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,EAAE;IACtF,IAAI,WAAW,GAAG,IAAI,CAAC;IACvB,IAAI,eAAe,GAAG,KAAK,CAAC;IAC5B,CAAC,GAAG,gBAAgB,EAAE,GAAG,kBAAkB,CAA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;IACxC,IAAI,yBAAyB,EAAE,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,UAAU,EAAE,EAAE;IACjD,MAAM,YAAY,GAAG,iBAAiB,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC;IAC7D,MAAM,eAAe,GAAG,GAAG,aAAa,EAAE,CAAC,UAAU,YAAY,CAAC;IAClE,OAAO,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;QAC5D,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,UAAU,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,EAAE;IAC/C,MAAM,WAAW,GAAG,yBAAyB,EAAE,CAAC;IAChD,OAAO,MAAM,IAAI,WAAW,CAAC;AAC/B,CAAC,CAAC","sourcesContent":["// Utility functions\nimport { getSiteConfig, getUrlByRouteRole } from '@openedx/frontend-base';\nimport * as QueryString from 'query-string';\n\nimport { dashboardRole } from '../../constants';\nimport { AUTH_PARAMS } from '../constants';\n\nexport const getTpaProvider = (tpaHintProvider, primaryProviders, secondaryProviders) => {\n let tpaProvider = null;\n let skipHintedLogin = false;\n [...primaryProviders, ...secondaryProviders].forEach((provider) => {\n if (provider.id === tpaHintProvider) {\n tpaProvider = provider;\n if (provider.skipHintedLogin) {\n skipHintedLogin = true;\n }\n }\n });\n return { provider: tpaProvider, skipHintedLogin };\n};\n\nexport const getTpaHint = () => {\n const params = QueryString.parse(window.location.search);\n let tpaHint = null;\n tpaHint = params.tpa_hint;\n if (!tpaHint) {\n const { next } = params;\n if (next) {\n const index = next.indexOf('tpa_hint=');\n if (index !== -1) {\n tpaHint = next.substring(index + 'tpa_hint='.length, next.length);\n }\n }\n }\n return tpaHint;\n};\n\nexport const updatePathWithQueryParams = (path) => {\n let queryParams = window.location.search;\n\n if (!queryParams) {\n return path;\n }\n\n if (queryParams.includes('track=pwreset')) {\n queryParams = queryParams.replace('?track=pwreset&', '?',).replace('?track=pwreset', '').replace('&track=pwreset', '').replace('?&', '?');\n }\n\n return `${path}${queryParams}`;\n};\n\nexport const getAllPossibleQueryParams = (locationURl = null) => {\n const urlParams = locationURl ? QueryString.parseUrl(locationURl).query : QueryString.parse(window.location.search);\n const params = {};\n Object.entries(urlParams).forEach(([key, value]) => {\n if (AUTH_PARAMS.includes(key)) {\n params[key] = value;\n }\n });\n\n return params;\n};\n\nexport const getActivationStatus = () => {\n const params = QueryString.parse(window.location.search);\n\n return params.account_activation_status;\n};\n\nexport const isScrollBehaviorSupported = () => 'scrollBehavior' in document.documentElement.style;\n\nexport const windowScrollTo = (options) => {\n if (isScrollBehaviorSupported()) {\n return window.scrollTo(options);\n }\n\n return window.scrollTo(options.top, options.left);\n};\n\n/**\n * Normalize a backend redirect URL: if the backend returns the LMS dashboard\n * URL (or nothing), replace it with the role-based dashboard URL so that SPA\n * navigation can be used when the dashboard lives in the same shell.\n */\nexport const normalizeRedirectUrl = (backendUrl) => {\n const dashboardUrl = getUrlByRouteRole(dashboardRole) || '/';\n const lmsDashboardUrl = `${getSiteConfig().lmsBaseUrl}/dashboard`;\n return (!backendUrl || backendUrl.startsWith(lmsDashboardUrl))\n ? dashboardUrl\n : backendUrl;\n};\n\nexport const isHostAvailableInQueryParams = () => {\n const queryParams = getAllPossibleQueryParams();\n return 'host' in queryParams;\n};\n"]}
@@ -1,3 +1,2 @@
1
- export { default as AsyncActionType } from "./reduxUtils";
2
1
  export { default as setCookie } from "./cookies";
3
- export { getTpaProvider, getTpaHint, getAllPossibleQueryParams, getActivationStatus, isHostAvailableInQueryParams, updatePathWithQueryParams, windowScrollTo } from "./dataUtils";
2
+ export { getTpaProvider, getTpaHint, getAllPossibleQueryParams, getActivationStatus, isHostAvailableInQueryParams, updatePathWithQueryParams, normalizeRedirectUrl, windowScrollTo } from "./dataUtils";
@@ -1,4 +1,3 @@
1
- export { getTpaProvider, getTpaHint, getAllPossibleQueryParams, getActivationStatus, isHostAvailableInQueryParams, updatePathWithQueryParams, windowScrollTo, } from './dataUtils';
2
- export { default as AsyncActionType } from './reduxUtils';
1
+ export { getTpaProvider, getTpaHint, getAllPossibleQueryParams, getActivationStatus, isHostAvailableInQueryParams, updatePathWithQueryParams, normalizeRedirectUrl, windowScrollTo, } from './dataUtils';
3
2
  export { default as setCookie } from './cookies';
4
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/utils/index.js"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,UAAU,EACV,yBAAyB,EACzB,mBAAmB,EACnB,4BAA4B,EAC5B,yBAAyB,EACzB,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export {\n getTpaProvider,\n getTpaHint,\n getAllPossibleQueryParams,\n getActivationStatus,\n isHostAvailableInQueryParams,\n updatePathWithQueryParams,\n windowScrollTo,\n} from './dataUtils';\nexport { default as AsyncActionType } from './reduxUtils';\nexport { default as setCookie } from './cookies';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/utils/index.js"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,UAAU,EACV,yBAAyB,EACzB,mBAAmB,EACnB,4BAA4B,EAC5B,yBAAyB,EACzB,oBAAoB,EACpB,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export {\n getTpaProvider,\n getTpaHint,\n getAllPossibleQueryParams,\n getActivationStatus,\n isHostAvailableInQueryParams,\n updatePathWithQueryParams,\n normalizeRedirectUrl,\n windowScrollTo,\n} from './dataUtils';\nexport { default as setCookie } from './cookies';\n"]}
@@ -1,36 +1,2 @@
1
- declare const _default: import("react-redux").ConnectedComponent<{
2
- (props: any): import("react/jsx-runtime").JSX.Element;
3
- propTypes: {
4
- email: PropTypes.Requireable<string>;
5
- emailValidationError: PropTypes.Requireable<string>;
6
- forgotPassword: PropTypes.Validator<(...args: any[]) => any>;
7
- setForgotPasswordFormData: PropTypes.Validator<(...args: any[]) => any>;
8
- status: PropTypes.Requireable<string>;
9
- submitState: PropTypes.Requireable<string>;
10
- };
11
- defaultProps: {
12
- email: string;
13
- emailValidationError: string;
14
- status: null;
15
- submitState: string;
16
- };
17
- }, {
18
- email?: string | null | undefined;
19
- forgotPassword: (...args: any[]) => any;
20
- status?: string | null | undefined;
21
- setForgotPasswordFormData: (...args: any[]) => any;
22
- emailValidationError?: string | null | undefined;
23
- submitState?: string | null | undefined;
24
- context?: import("react-redux/es/components/Context").ReactReduxContextInstance | undefined;
25
- store?: import("redux").Store | undefined;
26
- } | {
27
- email?: string | null | undefined;
28
- forgotPassword: (...args: any[]) => any;
29
- status?: string | null | undefined;
30
- setForgotPasswordFormData: (...args: any[]) => any;
31
- emailValidationError?: string | null | undefined;
32
- submitState?: string | null | undefined;
33
- store?: import("redux").Store | undefined;
34
- }>;
35
- export default _default;
36
- import PropTypes from 'prop-types';
1
+ export default ForgotPasswordPage;
2
+ declare function ForgotPasswordPage(): import("react/jsx-runtime").JSX.Element;
@@ -1,37 +1,38 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from 'react';
3
- import { connect } from 'react-redux';
4
- import { useAppConfig, getSiteConfig, sendPageEvent, sendTrackEvent, useIntl } from '@openedx/frontend-base';
3
+ import { getSiteConfig, getUrlByRouteRole, sendPageEvent, sendTrackEvent, useAppConfig, useIntl, } from '@openedx/frontend-base';
5
4
  import { Form, Hyperlink, Icon, StatefulButton, Tab, Tabs, } from '@openedx/paragon';
6
5
  import { ChevronLeft } from '@openedx/paragon/icons';
7
- import PropTypes from 'prop-types';
8
6
  import { Helmet } from 'react-helmet';
9
- import { useNavigate } from 'react-router-dom';
7
+ import { useLocation, useNavigate } from 'react-router-dom';
8
+ import { useForgotPassword } from './data/apiHook';
9
+ import ForgotPasswordAlert from './ForgotPasswordAlert';
10
+ import messages from './messages';
10
11
  import BaseContainer from '../base-container';
11
12
  import { FormGroup } from '../common-components';
12
- import { DEFAULT_STATE, LOGIN_PAGE, VALID_EMAIL_REGEX } from '../data/constants';
13
+ import { loginPath, loginRole } from '../constants';
14
+ import { VALID_EMAIL_REGEX } from '../data/constants';
13
15
  import { updatePathWithQueryParams, windowScrollTo } from '../data/utils';
14
- import { forgotPassword, setForgotPasswordFormData } from './data/actions';
15
- import { forgotPasswordResultSelector } from './data/selectors';
16
- import ForgotPasswordAlert from './ForgotPasswordAlert';
17
- import messages from './messages';
18
- const ForgotPasswordPage = (props) => {
16
+ const ForgotPasswordPage = () => {
17
+ var _a;
19
18
  const platformName = getSiteConfig().siteName;
20
19
  const emailRegex = new RegExp(VALID_EMAIL_REGEX, 'i');
21
- const { status, submitState, emailValidationError, } = props;
22
20
  const { formatMessage } = useIntl();
23
- const [email, setEmail] = useState(props.email);
21
+ const navigate = useNavigate();
22
+ const location = useLocation();
23
+ const appConfig = useAppConfig();
24
+ const [email, setEmail] = useState('');
24
25
  const [bannerEmail, setBannerEmail] = useState('');
25
26
  const [formErrors, setFormErrors] = useState('');
26
- const [validationError, setValidationError] = useState(emailValidationError);
27
- const navigate = useNavigate();
27
+ const [validationError, setValidationError] = useState('');
28
+ const [status, setStatus] = useState(((_a = location.state) === null || _a === void 0 ? void 0 : _a.status) || null);
29
+ // React Query hook for forgot password
30
+ const { mutate: sendForgotPassword, isPending: isSending } = useForgotPassword();
31
+ const submitState = isSending ? 'pending' : 'default';
28
32
  useEffect(() => {
29
33
  sendPageEvent('login_and_registration', 'reset');
30
34
  sendTrackEvent('edx.bi.password_reset_form.viewed', { category: 'user-engagement' });
31
35
  }, []);
32
- useEffect(() => {
33
- setValidationError(emailValidationError);
34
- }, [emailValidationError]);
35
36
  useEffect(() => {
36
37
  if (status === 'complete') {
37
38
  setEmail('');
@@ -48,44 +49,44 @@ const ForgotPasswordPage = (props) => {
48
49
  return error;
49
50
  };
50
51
  const handleBlur = () => {
51
- props.setForgotPasswordFormData({ email, emailValidationError: getValidationMessage(email) });
52
+ setValidationError(getValidationMessage(email));
53
+ };
54
+ const handleFocus = () => {
55
+ setValidationError('');
52
56
  };
53
- const handleFocus = () => props.setForgotPasswordFormData({ emailValidationError: '' });
54
57
  const handleSubmit = (e) => {
55
58
  e.preventDefault();
56
59
  setBannerEmail(email);
57
- const error = getValidationMessage(email);
58
- if (error) {
59
- setFormErrors(error);
60
- props.setForgotPasswordFormData({ email, emailValidationError: error });
60
+ const validateError = getValidationMessage(email);
61
+ if (validateError) {
62
+ setFormErrors(validateError);
63
+ setValidationError(validateError);
61
64
  windowScrollTo({ left: 0, top: 0, behavior: 'smooth' });
62
65
  }
63
66
  else {
64
- props.forgotPassword(email);
67
+ setFormErrors('');
68
+ sendForgotPassword(email, {
69
+ onSuccess: (data, emailUsed) => {
70
+ setStatus('complete');
71
+ setBannerEmail(emailUsed);
72
+ setFormErrors('');
73
+ },
74
+ onError: (error) => {
75
+ if (error.response && error.response.status === 403) {
76
+ setStatus('forbidden');
77
+ }
78
+ else {
79
+ setStatus('server-error');
80
+ }
81
+ },
82
+ });
65
83
  }
66
84
  };
67
85
  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.text']) })] }));
68
- return (_jsxs(BaseContainer, { children: [_jsx(Helmet, { children: _jsx("title", { children: formatMessage(messages['forgot.password.page.title'], { siteName: getSiteConfig().siteName }) }) }), _jsxs("div", { children: [_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(Form, { id: "forget-password-form", name: "forget-password-form", className: "mw-xs", children: [_jsx(ForgotPasswordAlert, { email: bannerEmail, emailError: formErrors, status: status }), _jsx("h2", { className: "h4", children: formatMessage(messages['forgot.password.page.heading']) }), _jsx("p", { className: "mb-4", children: formatMessage(messages['forgot.password.page.instructions']) }), _jsx(FormGroup, { floatingLabel: formatMessage(messages['forgot.password.page.email.field.label']), name: "email", value: email, autoComplete: "on", errorMessage: validationError, handleChange: (e) => setEmail(e.target.value), handleBlur: handleBlur, handleFocus: handleFocus, helpText: [formatMessage(messages['forgot.password.email.help.text'], { platformName })] }), _jsx(StatefulButton, { id: "submit-forget-password", name: "submit-forget-password", type: "submit", variant: "brand", className: "forgot-password--button", state: submitState, labels: {
86
+ return (_jsxs(BaseContainer, { children: [_jsx(Helmet, { children: _jsx("title", { children: formatMessage(messages['forgot.password.page.title'], { siteName: getSiteConfig().siteName }) }) }), _jsxs("div", { children: [_jsx(Tabs, { activeKey: "", id: "controlled-tab", onSelect: () => navigate(updatePathWithQueryParams(getUrlByRouteRole(loginRole))), children: _jsx(Tab, { title: tabTitle, eventKey: loginPath }) }), _jsx("div", { id: "main-content", className: "main-content", children: _jsxs(Form, { id: "forget-password-form", name: "forget-password-form", className: "mw-xs", children: [_jsx(ForgotPasswordAlert, { email: bannerEmail, emailError: formErrors, status: status }), _jsx("h2", { className: "h4", children: formatMessage(messages['forgot.password.page.heading']) }), _jsx("p", { className: "mb-4", children: formatMessage(messages['forgot.password.page.instructions']) }), _jsx(FormGroup, { floatingLabel: formatMessage(messages['forgot.password.page.email.field.label']), name: "email", value: email, autoComplete: "on", errorMessage: validationError, handleChange: (e) => setEmail(e.target.value), handleBlur: handleBlur, handleFocus: handleFocus, helpText: [formatMessage(messages['forgot.password.email.help.text'], { platformName })] }), _jsx(StatefulButton, { id: "submit-forget-password", name: "submit-forget-password", type: "submit", variant: "brand", className: "forgot-password--button", state: submitState, labels: {
69
87
  default: formatMessage(messages['forgot.password.page.submit.button']),
70
88
  pending: '',
71
- }, onClick: handleSubmit, onMouseDown: (e) => e.preventDefault() }), (useAppConfig().LOGIN_ISSUE_SUPPORT_LINK) && (_jsx(Hyperlink, { id: "forgot-password", name: "forgot-password", className: "ml-4 font-weight-500 text-body", destination: useAppConfig().LOGIN_ISSUE_SUPPORT_LINK, target: "_blank", showLaunchIcon: false, children: formatMessage(messages['need.help.sign.in.text']) })), _jsxs("p", { className: "mt-5.5 small text-gray-700", children: [formatMessage(messages['additional.help.text'], { platformName }), _jsx("span", { children: _jsx(Hyperlink, { isInline: true, destination: `mailto:${useAppConfig().INFO_EMAIL}`, children: useAppConfig().INFO_EMAIL }) })] })] }) })] })] }));
72
- };
73
- ForgotPasswordPage.propTypes = {
74
- email: PropTypes.string,
75
- emailValidationError: PropTypes.string,
76
- forgotPassword: PropTypes.func.isRequired,
77
- setForgotPasswordFormData: PropTypes.func.isRequired,
78
- status: PropTypes.string,
79
- submitState: PropTypes.string,
80
- };
81
- ForgotPasswordPage.defaultProps = {
82
- email: '',
83
- emailValidationError: '',
84
- status: null,
85
- submitState: DEFAULT_STATE,
89
+ }, onClick: handleSubmit, onMouseDown: (e) => e.preventDefault() }), (appConfig.LOGIN_ISSUE_SUPPORT_LINK) && (_jsx(Hyperlink, { id: "forgot-password", name: "forgot-password", className: "ml-4 font-weight-500 text-body", destination: appConfig.LOGIN_ISSUE_SUPPORT_LINK, target: "_blank", showLaunchIcon: false, children: formatMessage(messages['need.help.sign.in.text']) })), _jsxs("p", { className: "mt-5.5 small text-gray-700", children: [formatMessage(messages['additional.help.text'], { platformName }), _jsx("span", { className: "mx-1", children: _jsx(Hyperlink, { isInline: true, destination: `mailto:${appConfig.INFO_EMAIL}`, children: appConfig.INFO_EMAIL }) })] })] }) })] })] }));
86
90
  };
87
- export default connect(forgotPasswordResultSelector, {
88
- forgotPassword,
89
- setForgotPasswordFormData,
90
- })(ForgotPasswordPage);
91
+ export default ForgotPasswordPage;
91
92
  //# sourceMappingURL=ForgotPasswordPage.js.map