Skip to content

Commit

Permalink
#161 Handle 520 error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Apr 19, 2017
1 parent f7496ca commit 378d5e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions ui/app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,7 @@ angular.module('thehive', ['ngAnimate', 'ngMessages', 'ngSanitize', 'ui.bootstra
AuthenticationSrv.current(function(userData) {
return deferred.resolve(userData);
}, function(err, status) {
if (status === 520) {
return deferred.resolve('maintenance')
} else {
return deferred.resolve(status);
}

return deferred.resolve(status === 520 ? status : null);
});

return deferred.promise;
Expand Down
2 changes: 1 addition & 1 deletion ui/app/scripts/controllers/RootCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ angular.module('theHiveControllers').controller('RootCtrl',
function($scope, $uibModal, $location, $state, $base64, AuthenticationSrv, MispSrv, StreamSrv, StreamStatSrv, TemplateSrv, MetricsCacheSrv, AlertSrv, currentUser) {
'use strict';

if(currentUser === 'maintenance') {
if(currentUser === 520) {
$state.go('maintenance');
return;
}else if(!currentUser || !currentUser.id) {
Expand Down

0 comments on commit 378d5e2

Please sign in to comment.