Description
The route path constants in src/data/constants.js are defined as absolute paths with a leading /:
export const LOGIN_PAGE = '/login';
export const REGISTER_PAGE = '/register';
export const RESET_PAGE = '/reset';
export const AUTHN_PROGRESSIVE_PROFILING = '/welcome';
export const PAGE_NOT_FOUND = '/notfound';
These constants are used throughout the app in navigate() calls and <Navigate> components. Since the app's routes are now nested under a /authn parent route (see src/routes.jsx), these absolute paths navigate to /login, /register, etc. instead of the correct /authn/login, /authn/register, etc.
How to reproduce
- Navigate to
/authn/login
- Click the "Register" tab
- The browser navigates to
/register instead of /authn/register
Affected navigation points
All of these use the absolute-path constants with React Router navigation and are broken:
src/logistration/Logistration.jsx — navigate(LOGIN_PAGE) and <Navigate to={key}> (tab switching)
src/reset-password/ResetPasswordPage.jsx — navigate(RESET_PAGE) and navigate(LOGIN_PAGE)
src/login/ChangePasswordPrompt.jsx — navigate(RESET_PAGE)
src/common-components/EmbeddedRegistrationRoute.jsx — <Navigate to={PAGE_NOT_FOUND}>
src/common-components/RedirectLogistration.jsx — <Navigate to={AUTHN_PROGRESSIVE_PROFILING}>
src/common-components/EnterpriseSSO.jsx — window.location.href = LOGIN_PAGE (full-page redirect to bare /login)
Proposed fix
Description
The route path constants in
src/data/constants.jsare defined as absolute paths with a leading/:These constants are used throughout the app in
navigate()calls and<Navigate>components. Since the app's routes are now nested under a/authnparent route (seesrc/routes.jsx), these absolute paths navigate to/login,/register, etc. instead of the correct/authn/login,/authn/register, etc.How to reproduce
/authn/login/registerinstead of/authn/registerAffected navigation points
All of these use the absolute-path constants with React Router navigation and are broken:
src/logistration/Logistration.jsx—navigate(LOGIN_PAGE)and<Navigate to={key}>(tab switching)src/reset-password/ResetPasswordPage.jsx—navigate(RESET_PAGE)andnavigate(LOGIN_PAGE)src/login/ChangePasswordPrompt.jsx—navigate(RESET_PAGE)src/common-components/EmbeddedRegistrationRoute.jsx—<Navigate to={PAGE_NOT_FOUND}>src/common-components/RedirectLogistration.jsx—<Navigate to={AUTHN_PROGRESSIVE_PROFILING}>src/common-components/EnterpriseSSO.jsx—window.location.href = LOGIN_PAGE(full-page redirect to bare/login)Proposed fix