Merge "Fix refreshing while not logged-in issue"
This commit is contained in:
commit
2c24dee015
@ -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();
|
||||
|
@ -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 = [];
|
||||
|
@ -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';
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user