From 3a7810b6a9d71b96b29d32a4a39e504eb5fdc4dd Mon Sep 17 00:00:00 2001
From: rsanchez <rsanchez@curisit.net>
Date: Mon, 17 Apr 2017 16:45:21 +0000
Subject: [PATCH] #0 fix - Better message for unauthorzed access
---
securis/src/main/webapp/src/app/common/utils.ts | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/securis/src/main/webapp/src/app/common/utils.ts b/securis/src/main/webapp/src/app/common/utils.ts
index b60a4e4..6e63b6a 100644
--- a/securis/src/main/webapp/src/app/common/utils.ts
+++ b/securis/src/main/webapp/src/app/common/utils.ts
@@ -48,9 +48,12 @@
error.httpCode = errorResponse.status;
error.code = errorResponse.headers.get(ERROR_CODE_MESSAGE_HEADER) || error.httpCode;
- if (errorResponse.status === 403 /* forbidden */ || errorResponse.status === 401 /* unauthorized */) {
+ if (errorResponse.status === 403 /* forbidden */) {
error.message = this.$L.get('Invalid credentials');
error.code = ErrorCodes.INVALID_CREDENTIALS;
+ } else if (errorResponse.status === 401 /* unauthorized */) {
+ error.message = this.$L.get('Action not allowed for current user');
+ error.code = ErrorCodes.UNAUTHORIZED_ACCESS;
} else if (errorResponse.status === 418 /* Teapot */) {
error.message = errorResponse.headers.get(ERROR_MESSAGE_HEADER) || errorResponse.statusText || this.$L.get('Unknown');
} else {
--
Gitblit v1.3.2