Skip to content

Navigation constants use absolute paths, breaking routing under /authn prefix #1648

@arbrandes

Description

@arbrandes

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

  1. Navigate to /authn/login
  2. Click the "Register" tab
  3. 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:

  1. src/logistration/Logistration.jsxnavigate(LOGIN_PAGE) and <Navigate to={key}> (tab switching)
  2. src/reset-password/ResetPasswordPage.jsxnavigate(RESET_PAGE) and navigate(LOGIN_PAGE)
  3. src/login/ChangePasswordPrompt.jsxnavigate(RESET_PAGE)
  4. src/common-components/EmbeddedRegistrationRoute.jsx<Navigate to={PAGE_NOT_FOUND}>
  5. src/common-components/RedirectLogistration.jsx<Navigate to={AUTHN_PROGRESSIVE_PROFILING}>
  6. src/common-components/EnterpriseSSO.jsxwindow.location.href = LOGIN_PAGE (full-page redirect to bare /login)

Proposed fix

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions