-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authentication Fixes #170
Authentication Fixes #170
Conversation
Taking a look now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to break the "redirect to originally requested private route after login" functionality, as demoed here:
2022-10-30.17.54.32.mp4
I should be redirected to /submissions/4
, but instead I go to /welcome
and then /draw/1
.
d6b5164
to
8783b03
Compare
The code to fix this ended up being mixed with the utility selector so I assigned myself #164 and included the fixes here. I added a utility guard much like the auth guard (but that does not redirect). We might need to think about moving this further into the route tree. If a user visits a submission details page, they'll still have to select a utility. Perhaps if they visit a submission details page, we should auto select the utility based on the submission. |
Taking another look. I made #172 as a follow-up which may need the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 tested, nice work on this!
Another possibility to move the utility guard into PrivateRoutes so that it encapsulates only the routes that have multiple boundary possibilities. The others will set the utility themselves. |
This commit moves the private routes into their own component beneath and AuthGuard so they can access the user in the store.
This updates the utility selection process by adding a utility guard. This guard ensures that the app can't be reached without having selected a utility (if you are a contributor). This should handle the case where a user visits a page by directly entering a URL (or refreshing) and is already logged in.
8783b03
to
c06b947
Compare
Overview
This PR does mainly three things:
Closes #168
Closes #78
Closes #149
Closes #164
Demo
Screen.Recording.2022-10-28.at.3.59.24.PM.mov
Notes
The private routes are moved into an auth guard which prevents render of children until the user is authenticated.
The utility guard might need to moved into the private routes element and surround only certain elements. For example, if a user visits a submission details page, they'll still have to select a utility.
Testing Instructions
Checklist
fixup!
commits have been squashedCHANGELOG.md
updated with summary of features or fixes, following Keep a Changelog guidelinesREADME.md
updated if necessary to reflect the changes