-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Conversation
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.
fix linter
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.
Thanks! Would you mind renaming the pessimistic
prop to requireAuth
just like in the Admin
component?
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.
Thanks!
pessimistic
mode to <Authenticated /> componentpessimistic
mode to <Authenticated /> component
pessimistic
mode to <Authenticated /> componentrequiredAuth
to <Authenticated /> component
requiredAuth
to <Authenticated /> componentrequireAuth
to <Authenticated /> component
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.