The question is about how to handle Authenticated and Unauthenticated routes.
Say you have boolean stored in Redux state which essentially control what a logged in user sees and what an unauthenticated user sees. (Redux is just a placeholder, say you store it in localStorage as second example)
Something about this doesn't sit well with me. Just say the user figured out via inspecting the code that its all about toggling this variable. This opens up all the pages he did NOT have access to, and can lead to all kinds of unexpected behavior on the frontend...Edge cases that were not thought about ( add isLoggedIn
to already complicated combinations of states of other variables which control what the user sees.)
Is this okay? Can we just say we as developers are no longer responsible if you try to mess with code in browser dev tools? Or is there a better way to handle Authenticated and Unauthenticated routes?
Note: No confidential data would be yielded by the backend without the required access token. The question is just about allowing unauthenticated users to mess around with pages which were otherwise not visible to them.