If you refresh the browser, session service will lose the current user name breaking the whole design. I tried checking with the server if the user is logged in - but doing that in "onStateChangeStart" cannot be done even with a promise.
This is just an example, not a full implementation. Ideally, your login check should return the logged in user so you can set them inside your session.
If you refresh the browser, session service will lose the current user name breaking the whole design. I tried checking with the server if the user is logged in - but doing that in "onStateChangeStart" cannot be done even with a promise.