You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by to...@apache.org on 2015/08/31 22:28:51 UTC

[2/6] usergrid git commit: Fix errors that show in console when switching organizations that triggers a re-authentication. Also ensure insecure banner check knows the app for checking roles.

Fix errors that show in console when switching organizations that triggers a re-authentication.  Also ensure insecure banner check knows the app for checking roles.


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/55d825b7
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/55d825b7
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/55d825b7

Branch: refs/heads/two-dot-o-dev
Commit: 55d825b73e97657de796ea0d590dbc87b9315951
Parents: 061ba91
Author: Michael Russo <mi...@gmail.com>
Authored: Fri Aug 28 14:26:00 2015 -0700
Committer: Michael Russo <mi...@gmail.com>
Committed: Fri Aug 28 14:26:00 2015 -0700

----------------------------------------------------------------------
 portal/js/global/page-controller.js | 3 +--
 portal/js/global/ug-service.js      | 2 +-
 portal/js/login/login-controller.js | 5 +++++
 3 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/55d825b7/portal/js/global/page-controller.js
----------------------------------------------------------------------
diff --git a/portal/js/global/page-controller.js b/portal/js/global/page-controller.js
index 8108a34..1132eda 100644
--- a/portal/js/global/page-controller.js
+++ b/portal/js/global/page-controller.js
@@ -322,7 +322,6 @@ AppServices.Controllers.controller('PageCtrl',
       $rootScope.$emit('loginSuccesful', user, organizations, applications);
       $rootScope.$broadcast('checkAuthentication-success');
       $scope.applyScope(function() {
-        $scope.deferredLogin.resolve();
         $location.path('/org-overview');
       })
     });
@@ -417,4 +416,4 @@ AppServices.Controllers.controller('PageCtrl',
       }
     });
   }
-]);
\ No newline at end of file
+]);

http://git-wip-us.apache.org/repos/asf/usergrid/blob/55d825b7/portal/js/global/ug-service.js
----------------------------------------------------------------------
diff --git a/portal/js/global/ug-service.js b/portal/js/global/ug-service.js
index 233015b..6a9a99f 100644
--- a/portal/js/global/ug-service.js
+++ b/portal/js/global/ug-service.js
@@ -144,7 +144,7 @@ AppServices.Services.factory('ug', function(configuration, $rootScope, utility,
           $rootScope.applications = applications;
           $rootScope.currentOrg = ug.get('orgName');
           $rootScope.currentApp = ug.get('appName');
-          $rootScope.currentUser = user._data;
+          $rootScope.currentUser = data;
           $rootScope.currentUser.profileImg = utility.get_gravatar(
             $rootScope.currentUser.email);
         }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/55d825b7/portal/js/login/login-controller.js
----------------------------------------------------------------------
diff --git a/portal/js/login/login-controller.js b/portal/js/login/login-controller.js
index a20355e..25683bf 100755
--- a/portal/js/login/login-controller.js
+++ b/portal/js/login/login-controller.js
@@ -89,6 +89,11 @@ AppServices.Controllers.controller('LoginCtrl', ['ug', '$scope', '$rootScope', '
     $scope.loading = false;
     $scope.login = {};
 
+    // get the first app from logged in user and set this prop in the app for any initial app specific requests
+    var firstOrg = Object.keys($rootScope.currentUser.organizations)[0];
+    var firstApp = Object.keys($rootScope.currentUser.organizations[firstOrg].applications)[0];
+    ug.setClientProperty('appName', firstApp.split("/")[1]);
+
     //if on login page, send to org overview page.  if on a different page, let them stay there
     if ($rootScope.currentPath === '/login' || $rootScope.currentPath === '/login/loading' || typeof $rootScope.currentPath === 'undefined') {
       $location.path('/org-overview');