Skip to content

Feature: Route guarding #7

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

Merged
merged 2 commits into from
Jul 29, 2020
Merged

Feature: Route guarding #7

merged 2 commits into from
Jul 29, 2020

Conversation

soniaroh
Copy link
Owner

Implemented private routing for "/order" and "/view-order" routes.
  • created a PrivateRouter component that conditionally returns a route that checks if redux store's token has a truthy value
  • in the case that user is not logged in, the falsy token redirects the route to /login page
  • AppRouter component is connected to the store, so it can read the value of token and render routes accordingly.

closes Shift3#21

@soniaroh soniaroh merged commit f822b07 into dev Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant