What is the best way to implement login screen to an single page application? I want to restrict access to navigation bar (router links between views) and banner until user has logged in.
As banner and navigation bar are common for every other page than login page, I want to nest them in one place only and not to every page individually. Now they poll the login state from Redux and either returns DOM markup or null.
However, this makes the code somewhat obscure, as you can't deduce their behavior just by looking at the root component.
Is there a more declarative way to hide navigation bar from unauthorized user?
Aucun commentaire:
Enregistrer un commentaire