You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As we are loading the user information through angular's MainController, this happens in an ajax call which might end up finishing after other views have already been loaded.
This is causing some issues as the currently $scope.currentUser will be loaded too late in the process.
A specific scenario for testing would be to stop the application and start it on the following url #/index/users. Other subsequent refreshes on the page will somehow work.
Possible solutions
Store the user data in the browser.
When angular runs, inside the run block, check to see if user data is already loaded. If it is, continue with the requested page. If it's not, send to the login page.
Local storage
Pros
User can open new tabs, windows, close and re-open tabs and windows and he will still be logged in
Cons
This requires expiration management. It can be countered by using refresh tokens
Session storage
Pros
Does not require expiration management
Cons
Each time you open a new tab, new window, close and re-open tab or window, the User will have to re-authenticate which is very annoying
I would opt in for Local storage and by handling the expiration manually since we have authentication + authorization handled on the server as well and this information is not likely to change very often.
Keep in mind
user data should encapsulate all information from a user which is required in the browser
The text was updated successfully, but these errors were encountered:
Migrated from https://github.com/gov-ithub/auth-sso/issues/112
Originally created by @aoancea on Mon, 30 Jan 2017 18:38:53 GMT
As we are loading the user information through angular's
MainController
, this happens in an ajax call which might end up finishing after other views have already been loaded.This is causing some issues as the currently
$scope.currentUser
will be loaded too late in the process.A specific scenario for testing would be to stop the application and start it on the following url
#/index/users
. Other subsequent refreshes on the page will somehow work.Possible solutions
user data
in the browser.angular
runs, inside therun
block, check to see ifuser data
is already loaded. If it is, continue with the requested page. If it's not, send to the login page.Local storage
Pros
Cons
Session storage
Pros
Cons
I would opt in for
Local storage
and by handling the expiration manually since we have authentication + authorization handled on the server as well and this information is not likely to change very often.Keep in mind
user data
should encapsulate all information from a user which is required in the browserThe text was updated successfully, but these errors were encountered: