rsanchez
2017-04-17 3a7810b6a9d71b96b29d32a4a39e504eb5fdc4dd
#0 fix - Better message for unauthorzed access
1 files modified
changed files
securis/src/main/webapp/src/app/common/utils.ts patch | view | blame | history
securis/src/main/webapp/src/app/common/utils.ts
....@@ -48,9 +48,12 @@
4848 error.httpCode = errorResponse.status;
4949 error.code = errorResponse.headers.get(ERROR_CODE_MESSAGE_HEADER) || error.httpCode;
5050
51
- if (errorResponse.status === 403 /* forbidden */ || errorResponse.status === 401 /* unauthorized */) {
51
+ if (errorResponse.status === 403 /* forbidden */) {
5252 error.message = this.$L.get('Invalid credentials');
5353 error.code = ErrorCodes.INVALID_CREDENTIALS;
54
+ } else if (errorResponse.status === 401 /* unauthorized */) {
55
+ error.message = this.$L.get('Action not allowed for current user');
56
+ error.code = ErrorCodes.UNAUTHORIZED_ACCESS;
5457 } else if (errorResponse.status === 418 /* Teapot */) {
5558 error.message = errorResponse.headers.get(ERROR_MESSAGE_HEADER) || errorResponse.statusText || this.$L.get('Unknown');
5659 } else {