Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #645
What changes did you make?
/
to/signin
/profile
path from the protected paths in the e2e tests since it no longer exists/signout
a protected route. I noticed it wasn't protected and therefore wasn't causing a token refresh if they were expired.Rationale behind the changes?
I made these changes to correctly redirect the user based on 2 cases:
/
/signin
in pageOne issue I ran into was the
ProtectedRoute
component was redirecting the user after logging out instead of allowing us to choose the path. This was being caused by this line of code inapp/src/components/common/AuthenticatedHeader.tsx
:appDispatch(setCredentials({user: null, token: null}))
The
ProtectedRoute
component relies on the user object to determine whether to navigate the user to/signin
or render the necessary components. A change to the user object was causing the component to render<Navigate to="/signin" state={{from: location}} replace />;
and override our call tonavigate('/')
. By removing the state update we can now redirect the user to the home page. However, the user object is still stored in state, but since the credentials are no longer valid the user can't log in or access any protected routes. The user object will also be reset anytime the user revisits the application or a protected endpoint.Testing done for these changes
Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)
Visuals before changes are applied
Visuals after changes are applied
Screen.Recording.2024-01-17.at.12.58.00.PM.mov