Router v5 -> v6 migration: update auth/ pages
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:
- Using hooks such as
useLocation,useParams, anduseNavigateinstead of the previous API where they were passed as props - and
Navigateinstead ofRedirect - get rid of all props related to history being passed down the component tree by Router and direct imports from
historytoo - Update some of the components to be functional and use hooks
- Update tests
Test plan
Check the following cases manually:
-
/sign-inpage -
/sign-uppage- cloud sign-up (by manually making
context.sourcegraphDotComMode = trueinSignUpPage.tsx - post sign-up page (
/welcome) by signing in, then removing conditionals around<PostSignUpPage ...inroutes.tsx
- cloud sign-up (by manually making
- VSCode sign-up page:
/sign-up?editor=vscode /password-reset-
/unlock-account/somethingwith changingisLoadingtofalseand removing theprops.authenticatedUserconditional (as well as without removing it to check redirect) - 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.