Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2016-01-27 16:16:07 -0500
committerRyan D. Brooks2016-01-27 16:16:07 -0500
commit1fcf0fe9860f281626fb59babbf4c15db1c95a35 (patch)
treeca1c1ceaafe91d121e0425cc82267ca5ab5b94ff /plugins/org.eclipse.osee.web.ui
parentd7c359722bf1a6fd3ee5bd202657b273b3373409 (diff)
downloadorg.eclipse.osee-1fcf0fe9860f281626fb59babbf4c15db1c95a35.tar.gz
org.eclipse.osee-1fcf0fe9860f281626fb59babbf4c15db1c95a35.tar.xz
org.eclipse.osee-1fcf0fe9860f281626fb59babbf4c15db1c95a35.zip
bug: Fix authentication race condidtion
Diffstat (limited to 'plugins/org.eclipse.osee.web.ui')
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/libs/js/oseeAuth/oseeAuth.js1
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/osee/js/meController.js12
2 files changed, 9 insertions, 4 deletions
diff --git a/plugins/org.eclipse.osee.web.ui/src/libs/js/oseeAuth/oseeAuth.js b/plugins/org.eclipse.osee.web.ui/src/libs/js/oseeAuth/oseeAuth.js
index d610d5b77e..1292dc392b 100644
--- a/plugins/org.eclipse.osee.web.ui/src/libs/js/oseeAuth/oseeAuth.js
+++ b/plugins/org.eclipse.osee.web.ui/src/libs/js/oseeAuth/oseeAuth.js
@@ -147,6 +147,7 @@ directives.directive('osee', [
$localStorage.uuid = response.accountId;
$localStorage.guid = response.guid;
scope.profile = response;
+ $rootScope.$broadcast('osee:userAuthenticated');
});
if($localStorage.continueTo) {
// Change the state to the continueTo we caught when User first tried to get into page
diff --git a/plugins/org.eclipse.osee.web.ui/src/osee/js/meController.js b/plugins/org.eclipse.osee.web.ui/src/osee/js/meController.js
index 6e02d6b442..ca3188f795 100644
--- a/plugins/org.eclipse.osee.web.ui/src/osee/js/meController.js
+++ b/plugins/org.eclipse.osee.web.ui/src/osee/js/meController.js
@@ -89,16 +89,16 @@ app.controller('meController', [
$scope.defaultLinks = Object.keys(data.links).map(function (key) {return data.links[key]});
});
}
- $scope.getDefaultPreferences();
+
$scope.getPreferences = function() {
Preferences.get({
id: $localStorage.uuid
- }, function(data) {
- $scope.personalLinks = Object.keys(data.links).map(function (key) {return data.links[key]});
+ }, function(data2) {
+ $scope.personalLinks = Object.keys(data2.links).map(function (key) {return data2.links[key]});
});
}
- $scope.getPreferences();
+
$scope.createNewLink = function(name, url) {
var newLink = {};
@@ -150,5 +150,9 @@ app.controller('meController', [
$modalInstance.dismiss('cancel');
};
};
+ $scope.$on("osee:userAuthenticated", function(event, token) {
+ $scope.getDefaultPreferences();
+ $scope.getPreferences();
+ });
}]); \ No newline at end of file

Back to the top