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
, anduseNavigate
instead of the previous API where they were passed as props - and
Navigate
instead ofRedirect
- get rid of all props related to history being passed down the component tree by Router and direct imports from
history
too - Update some of the components to be functional and use hooks
- Update tests
Test plan
Check the following cases manually:
-
/sign-in
page -
/sign-up
page- cloud sign-up (by manually making
context.sourcegraphDotComMode = true
inSignUpPage.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/something
with changingisLoading
tofalse
and removing theprops.authenticatedUser
conditional (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.