Follow up of this question: React Router Authorization
I understand the example provided here
https://github.com/ReactTraining/react-router/blob/master/examples/auth-flow/app.js
But I think this only answers the question of authentication and not authorization. Wheter the user is authenticated or not only depends on the presence of a value at the location there should be a jwt token in local storage.
loggedIn() {
return !!localStorage.token
}
I know it will be impossible to do any server communication but what I'm after is completely hide my application behind a login. I don't see how I can achieve this in a SPA, should I split up my authentication and the rest of my application as 2 pages? What if I bring in roles?