Skip to content
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

Add requireAuth to <Authenticated /> component #7993

Merged
merged 6 commits into from
Jul 21, 2022
Merged

Add requireAuth to <Authenticated /> component #7993

merged 6 commits into from
Jul 21, 2022

Conversation

smeng9
Copy link
Contributor

@smeng9 smeng9 commented Jul 21, 2022

The useAuthenticated() hook and old <Authenticated /> component is always optimistic, other auth hooks cannot be used directly inside <Route element> and causes boilerplate, and <Admin requireAuth> completely disallows anonymous access to all the pages.

This feature gives user finer granularity of control of which custom routes can be anonymously accessed, which can be optimistically rendered, and which should not leak the UI and does not have flash of UI.

Copy link
Contributor Author

@smeng9 smeng9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix linter

Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Would you mind renaming the pessimistic prop to requireAuth just like in the Admin component?

@djhi djhi added this to the 4.3 milestone Jul 21, 2022
Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@djhi djhi changed the title feat: Add pessimistic mode to <Authenticated /> component Add pessimistic mode to <Authenticated /> component Jul 21, 2022
@djhi djhi changed the title Add pessimistic mode to <Authenticated /> component Add requiredAuth to <Authenticated /> component Jul 21, 2022
@djhi djhi changed the title Add requiredAuth to <Authenticated /> component Add requireAuth to <Authenticated /> component Jul 21, 2022
@djhi djhi merged commit 8841616 into marmelab:next Jul 21, 2022
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.

2 participants