PasswordField is a shared component used across login, registration,
and reset-password flows, but it was reaching directly into
RegisterContext for validation state and callbacks. Replace context
coupling with explicit props (validateField, clearRegistrationBackendError,
validationApiRateLimited) passed by RegistrationPage, and remove the
now-unused useRegisterContextOptional hook.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds tests that were removed or simplified during the Redux-to-React-Query
migration, as identified in PR #1641 review.
Logistration: CSRF token on mount, institution login page events for both
login and register pages, institution login track+page event assertions.
LoginPage: reset password banner dismissal on form submit, SSO redirect
to finishAuthUrl, and redirectUrl precedence over finishAuthUrl.
ProgressiveProfiling: sendPageEvent('login_and_registration', 'welcome')
assertion on component mount.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove unused useThirdPartyAuthHook mock body, inline dead
mockSetShowError variable, and extract shared TPA context mock
constant in Logistration tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add USER_RETENTION_COOKIE_NAME and SESSION_COOKIE_DOMAIN to the
dependency array instead of suppressing react-hooks/exhaustive-deps.
Both are config constants from useAppConfig() that never change at
runtime, so behavior is unchanged.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
In ProgressiveProfiling, the TPA query fired even when
registrationEmbedded was false and the result was ignored. Added an
enabled option to useThirdPartyAuthHook and set it to
registrationEmbedded in ProgressiveProfiling.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
It was being called on every data sync effect run, causing a flash of
PENDING state even when TPA data was already available.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The query key only included pageId, so if the payload (tpa_hint, query
params, etc.) changed while pageId stayed the same, React Query would
serve stale cached data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The TPA context is effectively static per session. Adding a 5-minute
staleTime prevents unnecessary background refetches when navigating
between login/register tabs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
LoginContext setFormFields/setErrors are useState setters that accept
updater functions, so their types should be Dispatch<SetStateAction<...>>
rather than plain function signatures.
PASSWORD_RESET_ERROR was checked in ResetPasswordPage but no code path
ever set status to that value, making the conditions dead code.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When shouldRedirect was true and welcomePageContext.nextUrl was truthy,
both RedirectLogistration components rendered simultaneously, causing a
double redirect attempt. The first block was a subset of the second, so
removing it is sufficient.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
validateInput was directly mutating the formErrors state object and
then spreading it. When handleSubmit called validateInput twice in
succession, the second call operated on stale closure values because
React batches state updates. Also fixed handleOnFocus for the same
issue.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Calling navigate() during the render phase triggers state updates in
the router, causing React warnings and potential infinite render loops
in strict mode.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The function expects two string arguments (suggestion, type) but was
being called with a single object, corrupting the email suggestion state.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace Redux + Redux-Saga with React Query (useMutation/useQuery) for
server state and React Context for UI/form state across all modules:
login, registration, forgot-password, reset-password, progressive-
profiling, and common-components.
Port of master commits 0d709d15 and 93bd0f24, adapted for
@openedx/frontend-base:
- getSiteConfig() instead of getConfig()
- useAppConfig() for per-app configuration
- @tanstack/react-query as peerDependency (shell provides QueryClient)
- CurrentAppProvider instead of AppProvider
Also fixes EnvironmentTypes circular dependency in site.config.test.tsx
by using string literal instead of enum import.
Co-Authored-By: Jesus Balderrama <jesus.balderrama.wgu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This change adds a Slot for the login page allowing it to be customised.
Since this touched the Login Page, LoginPage and Logistration have also
been refactored to move away from redux connect.
Adapted for frontend-base: uses Slot from @openedx/frontend-base instead
of PluginSlot from @openedx/frontend-plugin-framework, slot files live
under src/slots/, and the slot ID follows the frontend-base naming
convention (org.openedx.frontend.slot.authn.loginComponent.v1).
Co-Authored-By: Adolfo R. Brandes <adolfo@axim.org>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Configure the package to compile TypeScript and copy SCSS files to dist/
before publishing, rather than publishing raw source files. This allows
us to use tsc-alias for @src imports.
Also use a more modern export map to decouple the internal file
structure from the package's API, and add a build step to CI.
BREAKING CHANGE: Consuming projects may need to update their imports or
SASS @use lines.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
An issue was found when using Node version 24.9 with the latest
package-lock (see #123), one not reproducible with versions 24.12 and
above. Add a warning that will be shown when running `npm ci`.