Skip to content

Commit

Permalink
GDB-8826: Stop refreshing the operations status when security is enab…
Browse files Browse the repository at this point in the history
…led and the user is logged out.

## What
There is a redundant backend call to fetch running operations information when security is enabled, and the user is not logged in.

## Why
The check for security status and user login is not implemented.

## How
A Check to verify user authentication has been added before sending the request.
  • Loading branch information
boyan-tonchev committed Sep 26, 2023
1 parent e7f4cbd commit 2a7b902
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const UPDATE_ACTIVE_OPERATION_TIME_INTERVAL = 2000;
angular.module('graphdb.framework.core.directives.operationsstatusesmonitor', [])
.directive('operationsStatusesMonitor', operationsStatusesMonitorDirectives);

operationsStatusesMonitorDirectives.$inject = ['$interval', '$repositories', 'MonitoringRestService'];
operationsStatusesMonitorDirectives.$inject = ['$interval', '$repositories', 'MonitoringRestService', '$jwtAuth'];

function operationsStatusesMonitorDirectives($interval, $repositories, MonitoringRestService) {
function operationsStatusesMonitorDirectives($interval, $repositories, MonitoringRestService, $jwtAuth) {

return {
restrict: 'E',
Expand Down Expand Up @@ -82,7 +82,7 @@ function operationsStatusesMonitorDirectives($interval, $repositories, Monitorin
};

const reloadActiveOperations = () => {
if (updateActiveRepositoryRun) {
if (!$jwtAuth.isAuthenticated() || updateActiveRepositoryRun) {
return;
}

Expand Down

0 comments on commit 2a7b902

Please sign in to comment.