Final Enhancements
This is the last step in redirecting users to protected routes based on authorization.
We'll cover the following...
We'll cover the following...
Further Security
One refinement can be made in the withAuthorization higher-order component using the authenticated user from the context:
The improvement in the render method was needed to avoid showing the protected page before the redirect happens. We want to show nothing if the authenticated user doesn’t meet the condition’s criteria.
In such a case, it’s fine if the listener is too late to redirect the user. ...