singpath / classmentors

Class Mentors UI
http://www.classmentors.com
MIT License
0 stars 8 forks source link

fix authentication and reloading #94

Closed dinoboff closed 8 years ago

dinoboff commented 8 years ago

Authentication seems to be broken. when the page load, authentication will report the user as unauthenticated before checking if it's authenticated. As a result, reloading the page will fail it the current page points to a route requiring a logged in user.

Most route are relying on their "resolve" property to load async resources and cancel the route if the user is not allow to view (all the initialData resolver service). It's quiet complicated and force a reload of the route if some preretirements changes.

It would be better to have all route controllers or components load the resource and report error themselves and how to fix it (see the new admin component as example).

But in the mean time I should make authentication behave like before.

dinoboff commented 8 years ago

The current user initial state is always null. I am not sure i can fix it without an update to spfAuth API. Note that the new CurrentUser service has the same issue but include a $loaded method to handle this issue.