-
Notifications
You must be signed in to change notification settings - Fork 1
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
[JH] Restrict Route Access #52
Conversation
Visit the preview URL for this PR (updated for commit 1ad7245): https://tcl-69-smart-shopping-list--pr52-jh-restrict-signout-cbhhbtp7.web.app (expires Fri, 29 Mar 2024 22:36:56 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 93172cc46147b7d365c2b1b8239b61e2efb07a80 |
The original idea was to implement useContext to share current user info. However, there is already a current user object from the useAuth hook set up in App.jsx. |
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.
Curious why you chose not to useContext?
I think the way you accomplished this was super clean and to the point.
Great work!
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.
Looks great! Works as it should.
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.
Nice, works as expected!
…-shopping-list into jh-restrict-signout-route-access
Description
This code restricts route access to "List" and "Manage List" when user is not signed in. Using the
<Navigate>
component, user is redirected to "Home" or "/" route path to sign in.Note: The route path to "Home" currently renders information about user's lists. This may be changed to the landing page in a future issue.
Related Issue
Closes #51
Sub-issue of #14
Acceptance Criteria
Type of Changes
Use one or more labels to help your team understand the nature of the change(s) you’re proposing. E.g.,
bug fix
orenhancement
are common ones.Updates
Before
Successfully navigated to "Manage List" page without signing in.
After
Page redirected to "Home" when clicking on "Manage List."
Testing Steps / QA Criteria