Skip to content

Router v5 -> v6 migration: update auth/ pages

Warren Gifford requested to merge og/router-v6-auth-routes into main

Created by: oleggromov

Description

This is a part of the Router v5 -> v6 migration that performs the 1st step of gradual update, updating the authentication related pages.

We're changing:

  1. Using hooks such as useLocation, useParams, and useNavigate instead of the previous API where they were passed as props
  2. and Navigate instead of Redirect
  3. get rid of all props related to history being passed down the component tree by Router and direct imports from history too
  4. Update some of the components to be functional and use hooks
  5. Update tests

Test plan

Check the following cases manually:

  1. /sign-in page
  2. /sign-up page
    • cloud sign-up (by manually making context.sourcegraphDotComMode = true in SignUpPage.tsx
    • post sign-up page (/welcome) by signing in, then removing conditionals around <PostSignUpPage ... in routes.tsx
  3. VSCode sign-up page: /sign-up?editor=vscode
  4. /password-reset
  5. /unlock-account/something with changing isLoading to false and removing the props.authenticatedUser conditional (as well as without removing it to check redirect)
  6. Redirects when not authenticated from routes such as /batch-changes

Ensure tests and all other checks are passing.

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading