This seems like a confusing design to me. One of my UI rules is “don’t provide a way for users to do things I don’t want them to do”, so I would do away with the guard and simply not show any elements that would attempt to log in if you don’t want that happening.
I also think it’s confusing to have all these login forms all over the place.
If you want to support guest users, then have the Account page be a chimera of user preferences (if logged in) or a login form (if not). That way there is no concept of “the Login page”, no guard needed, and no problem.
If you don’t need to support guests, then merely switch the top-level rootPage
to either DashboardPage
(tab container) or LoginPage
depending on login status. If you search the forums for logout user:rapropos
, you will probably find a bunch of posts like this one containing sample code for how I handle user authentication.