diff --git a/frontend/app/scripts/services/api/AuthenticationSrv.js b/frontend/app/scripts/services/api/AuthenticationSrv.js index 4c12d0e015..8643165ddd 100644 --- a/frontend/app/scripts/services/api/AuthenticationSrv.js +++ b/frontend/app/scripts/services/api/AuthenticationSrv.js @@ -5,6 +5,7 @@ .factory('AuthenticationSrv', function($http, $q, UtilsSrv, SecuritySrv, UserSrv) { var self = { currentUser: null, + homeState: null, login: function(username, password, code) { var post = { user: username, @@ -49,8 +50,15 @@ var userData = response.data; self.currentUser = userData; - UserSrv.updateCache(userData.login, userData); - UtilsSrv.shallowClearAndCopy(userData, result); + + if(self.isSuperAdmin()) { + self.currentUser.homeState = 'app.administration.organisations'; + } else { + self.currentUser.homeState = 'app.cases'; + } + + UserSrv.updateCache(self.currentUser.login, self.currentUser); + UtilsSrv.shallowClearAndCopy(self.currentUser, result); return $q.resolve(result); }) diff --git a/frontend/app/views/components/header.component.html b/frontend/app/views/components/header.component.html index 7008041519..7ffeb46a8b 100644 --- a/frontend/app/views/components/header.component.html +++ b/frontend/app/views/components/header.component.html @@ -7,7 +7,8 @@ - + + TheHive