Skip to content

Commit

Permalink
C2C-75: Simplify 403 handling in HTTP error interceptor (Bahmni#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
enyachoke authored and rbuisson committed Mar 22, 2023
1 parent ab26677 commit 27dcbd7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ui/app/common/util/httpErrorInterceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,7 @@ angular.module('httpErrorInterceptor', [])
var errorMessage = data.error && data.error.message ? data.error.message : (data.localizedMessage || "Could not connect to the server. Please check your connection and try again");
showError(errorMessage);
} else if (response.status === 403) {
var errorMessage = data.error && data.error.message ? data.error.message : unexpectedError;
if (shouldRedirectToLogin(response)) {
$rootScope.$broadcast('event:auth-loginRequired');
} else {
showError(errorMessage);
}
$rootScope.$broadcast('event:auth-loginRequired');
} else if (response.status === 404) {
if (!_.includes(response.config.url, "implementation_config") && !_.includes(response.config.url, "locale_")
&& !_.includes(response.config.url, "offlineMetadata")) {
Expand Down

0 comments on commit 27dcbd7

Please sign in to comment.