Merge "Fix refreshing while not logged-in issue"

This commit is contained in:
Jenkins 2015-09-16 17:28:09 +00:00 committed by Gerrit Code Review
commit 2c24dee015
3 changed files with 9 additions and 3 deletions

View File

@ -96,7 +96,6 @@ refstackApp.run(['$http', '$rootScope', '$window', '$state', 'refstackApiUrl',
error(function () {
$rootScope.auth.currentUser = null;
$rootScope.auth.isAuthenticated = false;
$state.go('home');
});
};
$rootScope.auth.doSignCheck();

View File

@ -15,11 +15,15 @@ refstackApp.factory('PubKeys',
refstackApp.controller('profileController',
[
'$scope', '$http', 'refstackApiUrl', 'PubKeys',
'$modal', 'raiseAlert',
'$modal', 'raiseAlert', '$state',
function($scope, $http, refstackApiUrl,
PubKeys, $modal, raiseAlert) {
PubKeys, $modal, raiseAlert, $state) {
'use strict';
if (!$scope.auth.isAuthenticated) {
$state.go('home');
}
$scope.updatePubKeys = function (){
var keys = PubKeys.query(function(){
$scope.pubkeys = [];

View File

@ -34,6 +34,9 @@ refstackApp.controller('resultsController',
$scope.endDate = '';
$scope.isUserResults = $state.current.name === 'userResults';
if ($scope.isUserResults && !$scope.auth.isAuthenticated) {
$state.go('home');
}
$scope.pageHeader = $scope.isUserResults ?
'Private test results' : 'Community test results';
/**