@progress-chef/platform-http-interceptor 1.0.34 → 1.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,9 @@ class HttpAuthInterceptor {
26
26
  '/node/bulk-approve',
27
27
  '/dsm/store-service/v1/databags'
28
28
  ];
29
+ this.APIS_TO_EXCLUDE_FROM_500_NOTIFICATION = [
30
+ '/platform/system/v1/organization/:/create-dsm'
31
+ ];
29
32
  }
30
33
  intercept(request, next) {
31
34
  if (!this.isTokenRefreshInProgress()) {
@@ -243,6 +246,15 @@ class HttpAuthInterceptor {
243
246
  }
244
247
  break;
245
248
  case 500:
249
+ if (this.APIS_TO_EXCLUDE_FROM_500_NOTIFICATION.some(url => {
250
+ if (url.includes(':')) {
251
+ const urlParts = url.split(':');
252
+ return request.url.includes(urlParts[0]) && request.url.includes(urlParts[1]);
253
+ }
254
+ return request.url.includes(url);
255
+ })) {
256
+ break;
257
+ }
246
258
  try {
247
259
  for (let err of error?.error?.errors) {
248
260
  this.toastNotificationService.showToastNotification({
@@ -1 +1 @@
1
- {"version":3,"file":"progress-chef-platform-http-interceptor.mjs","sources":["../../../projects/platform-http-interceptor/src/lib/http-auth.interceptor.ts","../../../projects/platform-http-interceptor/src/public-api.ts","../../../projects/platform-http-interceptor/src/progress-chef-platform-http-interceptor.ts"],"sourcesContent":["import {\n HttpErrorResponse, HttpEvent, HttpEventType, HttpHandler, HttpInterceptor, HttpRequest\n} from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { LocalStorageService, StorageKeys } from '@progress-chef/platform-storage-service';\nimport { ToastNotificationService } from \"@progress-chef/platform-toast-notification-service\";\nimport { Observable, catchError, finalize, tap, throwError, Subject, switchMap } from \"rxjs\";\n\n@Injectable({\n providedIn: 'root'\n})\n\nexport class HttpAuthInterceptor implements HttpInterceptor {\n authTokenSet = new Set();\n isSessionExpired = false;\n requestQueue: QueuedRequest[] = [];\n storageListenerTimer: any;\n REFRESH_TOKEN_URL = '/identity/user/jwt/refresh';\n SSO_TOKEN_URL = '/sso/api/v1/token';\n LOCAL_LOGIN_URL = '/identity/user/login';\n JWT_URL = '/identity/user/jwt';\n ORGANIZATIONS_URL = '/self/organizations';\n ROLES_URL = '/self/roles';\n APIS_TO_EXCLUDE_AUTH_HEADER = [\n '&X-Amz-Signature='\n ];\n APIS_TO_EXCLUDE_FROM_207_NOTIFICATION = [\n '/node/bulk-approve',\n '/dsm/store-service/v1/databags'\n ];\n\n constructor(\n private readonly router: Router,\n private readonly toastNotificationService: ToastNotificationService\n ) { }\n\n intercept(\n request: HttpRequest<unknown>,\n next: HttpHandler\n ): Observable<HttpEvent<unknown>> {\n if (!this.isTokenRefreshInProgress()) {\n return this.processHttpHandle(request, next);\n } else {\n if (request.url.includes(this.REFRESH_TOKEN_URL)) {\n LocalStorageService.setItem(StorageKeys.TOKEN_REFRESH, { \"active\": true, \"time\": new Date().getTime() });\n }\n this.startStorageListenerTimer();\n return this.createQueueRequest(request).pipe(\n switchMap((req: HttpRequest<any>) => {\n return this.processHttpHandle(req, next);\n })\n );\n }\n }\n\n isTokenRefreshInProgress(): boolean {\n return LocalStorageService.getItem(\n StorageKeys.TOKEN_REFRESH\n )?.active;\n }\n\n processQueue(): void {\n const nextRequest = this.requestQueue.shift();\n if (nextRequest) {\n nextRequest.notifier.next(nextRequest.req);\n }\n }\n\n createQueueRequest(request: HttpRequest<unknown>): Observable<any> {\n const requestObj: QueuedRequest = {} as QueuedRequest;\n requestObj.req = request;\n requestObj.notifier = new Subject<HttpRequest<any>>();\n this.requestQueue.push(requestObj);\n return requestObj.notifier.asObservable();\n }\n\n startStorageListenerTimer(): void {\n if (this.storageListenerTimer) {\n clearInterval(this.storageListenerTimer);\n }\n this.storageListenerTimer = setInterval(() => {\n if (LocalStorageService.getItem(StorageKeys.TOKEN_REFRESH) &&\n LocalStorageService.getItem(StorageKeys.TOKEN_REFRESH).active === false) {\n clearInterval(this.storageListenerTimer);\n this.processQueue();\n }\n }, 200);\n }\n\n processHttpHandle(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n let authToken = LocalStorageService.getItem(StorageKeys.AUTH_TOKEN);\n let authReq = request;\n if (authToken) {\n if (!(this.APIS_TO_EXCLUDE_AUTH_HEADER.some(url => request.url.includes(url)))) {\n authReq = request.clone({\n setHeaders: {\n Authorization: `Bearer ${authToken}`\n }\n })\n }\n if (!this.authTokenSet.has(authToken)) {\n this.isSessionExpired = false;\n }\n this.authTokenSet.add(authToken);\n }\n return next.handle(authReq).pipe(\n tap((event) => {\n if (event.type === HttpEventType.Response) {\n switch (event.status) {\n case 202:\n this.toastNotificationService.showToastNotification({\n content: event?.body?.item?.message || `Request under processing`,\n type: { style: 'info', icon: true },\n action: {}\n });\n break;\n case 207:\n if (this.APIS_TO_EXCLUDE_FROM_207_NOTIFICATION.some(url => request.url.includes(url))) {\n break;\n }\n let message = {\n content: 'Request was successful',\n notificationStyle: 'success',\n closable: false\n }\n try {\n for (let item of event.body?.items) {\n for (let err of item?.userRoleMapping) { /* Currently 207 is handled only for single use case, so it is hardcoded.If there are more use cases, then this should be updated accordingly. */\n if (err.error !== null) {\n message = {\n content: 'User not allowed for this operation',\n notificationStyle: 'error',\n closable: true\n }\n }\n }\n }\n this.toastNotificationService.showToastNotification({\n content: message.content,\n type: { style: message.notificationStyle, icon: true },\n closable: message.closable,\n action: {}\n });\n } catch (e) {\n console.log(\"Exception occurred at HttpAuthInterceptor 207 notification\", e);\n this.toastNotificationService.showToastNotification({\n content: `The request has been accepted for processing, but has been partially completed.`,\n type: { style: 'info', icon: true },\n action: {}\n });\n }\n break;\n }\n }\n }),\n catchError((error: HttpErrorResponse) => {\n const loginType = LocalStorageService.getItem(StorageKeys.LOGIN_TYPE);\n if (this.router.url.includes('/login/user-login')) {\n const skipUrls = [\n this.JWT_URL,\n this.SSO_TOKEN_URL,\n this.LOCAL_LOGIN_URL,\n this.ORGANIZATIONS_URL,\n this.ROLES_URL\n ];\n if (skipUrls.some(url => request.url.includes(url))) {\n // Skip error handling for these URLs; errors will be handled by corresponding web components\n return throwError(() => error);\n }\n }\n switch (error.status) {\n case 401:\n if (loginType === 'saml' || loginType === 'oauth') {\n LocalStorageService.removeItem(StorageKeys.USER_NAME);\n LocalStorageService.removeItem(StorageKeys.IS_REMEMBER_ME);\n }\n LocalStorageService.setItem(StorageKeys.IS_USER_ORG_AND_ROLE_SET, false);\n LocalStorageService.setItem(StorageKeys.IS_USER_AUTHENTICATED, false);\n LocalStorageService.removeItem(StorageKeys.AUTH_TOKEN);\n LocalStorageService.removeItem(StorageKeys.LOGIN_TYPE);\n LocalStorageService.removeItem(StorageKeys.IDENTITY_TOKEN);\n LocalStorageService.removeItem(StorageKeys.USER_ORG_AND_ROLE_TOKEN);\n LocalStorageService.removeItem(StorageKeys.LICENSE_DETAILS);\n\n if (this.router.url.startsWith('/login/user-login')) {\n this.handleUnauthorizedError(error);\n } else {\n this.router.navigate(['/login']).then((navigated) => {\n if (navigated) {\n this.handleUnauthorizedError(error);\n }\n })\n }\n break;\n case 402:\n if (loginType === 'saml' || loginType === 'oauth') {\n LocalStorageService.removeItem(StorageKeys.USER_NAME);\n LocalStorageService.removeItem(StorageKeys.IS_REMEMBER_ME);\n }\n LocalStorageService.setItem(StorageKeys.IS_USER_ORG_AND_ROLE_SET, false);\n LocalStorageService.setItem(StorageKeys.IS_USER_AUTHENTICATED, false);\n LocalStorageService.removeItem(StorageKeys.AUTH_TOKEN);\n LocalStorageService.removeItem(StorageKeys.LOGIN_TYPE);\n LocalStorageService.removeItem(StorageKeys.IDENTITY_TOKEN);\n LocalStorageService.removeItem(StorageKeys.USER_ORG_AND_ROLE_TOKEN);\n LocalStorageService.removeItem(StorageKeys.LICENSE_DETAILS);\n\n this.router.navigate(['/login']).then((navigated) => {\n if (navigated) {\n this.toastNotificationService.showToastNotification({\n content: `License expired, please contact your support representative.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n })\n break;\n case 403:\n try {\n for (let err of error.error.errors) {\n const message = err?.message?.toLowerCase();\n const content = message?.includes('one time password') && message?.includes('expired')\n ? 'One Time Password entered has already expired.'\n : 'This operation is not permitted for the current role.';\n\n this.toastNotificationService.showToastNotification({\n content,\n type: { style: 'error', icon: true },\n closable: true,\n action: {},\n });\n }\n } catch (e) {\n console.log(\"HttpAuthInterceptor: Exception occurred at 403\", e);\n this.toastNotificationService.showToastNotification({\n content: `This operation is not permitted for the current role.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n break;\n case 405:\n try {\n for (let err of error.error.errors) {\n this.toastNotificationService.showToastNotification({\n content: err?.reason || `HTTP method not allowed.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n } catch (e) {\n console.log(\"HttpAuthInterceptor: Exception occurred at 405\", e);\n this.toastNotificationService.showToastNotification({\n content: `HTTP method not allowed.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n break;\n case 500:\n try {\n for (let err of error?.error?.errors) {\n this.toastNotificationService.showToastNotification({\n content: err?.message || `Something went wrong. Please try again.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n } catch (e) {\n console.log(\"HttpAuthInterceptor: Exception occurred at 500\", e);\n this.toastNotificationService.showToastNotification({\n content: `Something went wrong. Please try again.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n break;\n case 502:\n this.toastNotificationService.showToastNotification({\n content: `Bad Gateway. Please try again.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n break;\n case 503:\n this.toastNotificationService.showToastNotification({\n content: `Service Unavailable. Please try again.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n break;\n case 0:\n case 504:\n this.toastNotificationService.showToastNotification({\n content: `Unable to reach server. Please try again.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n break;\n\n }\n return throwError(() => error);\n }),\n finalize(() => {\n if (!this.isTokenRefreshInProgress()) {\n this.processQueue(); // Process next request in the queue\n }\n })\n );\n }\n\n handleUnauthorizedError(error: HttpErrorResponse) {\n try {\n for (let err of error?.error?.errors) {\n let message = '';\n if (err?.message.toLowerCase() === 'invalid credentials') {\n message = 'Invalid username or password.';\n } else if (err?.message.includes('expired')) {\n message = 'Your session has expired. Please login again.';\n }\n this.toastNotificationService.showToastNotification({\n content: message || err?.message || `Unauthorized`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n } catch (e) {\n console.log(\"HttpAuthInterceptor: Exception occurred at 401\", e);\n this.toastNotificationService.showToastNotification({\n content: `Something went wrong. Please try again.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n }\n}\n\ninterface QueuedRequest {\n req: HttpRequest<any>;\n notifier: Subject<any>;\n}\n","/*\n * Public API Surface of platform-http-interceptor\n */\n\nexport * from './lib/http-auth.interceptor';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAaa,mBAAmB,CAAA;IAmB9B,WAAA,CACmB,MAAc,EACd,wBAAkD,EAAA;QADlD,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,wBAAwB,GAAxB,wBAAwB;AApB3C,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,GAAG,EAAE;QACxB,IAAA,CAAA,gBAAgB,GAAG,KAAK;QACxB,IAAA,CAAA,YAAY,GAAoB,EAAE;QAElC,IAAA,CAAA,iBAAiB,GAAG,4BAA4B;QAChD,IAAA,CAAA,aAAa,GAAG,mBAAmB;QACnC,IAAA,CAAA,eAAe,GAAG,sBAAsB;QACxC,IAAA,CAAA,OAAO,GAAG,oBAAoB;QAC9B,IAAA,CAAA,iBAAiB,GAAG,qBAAqB;QACzC,IAAA,CAAA,SAAS,GAAG,aAAa;AACzB,QAAA,IAAA,CAAA,2BAA2B,GAAG;YAC5B;SACD;AACD,QAAA,IAAA,C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AC,gDAAgD,EAAE,CAAC,CAAC;AAChE,YAAA,IAAI,CAAC,wBAAwB,CAAC,qBAAqB,CAAC;AAClD,gBAAA,OAAO,EAAE,CAAA,uCAAA,CAAyC;gBAClD,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE;AACpC,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,MAAM,EAAE;AACT,aAAA,CAAC;QACJ;IACF;+GA7UW,mBAAmB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,MAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,wBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAHlB,MAAM,EAAA,CAAA,CAAA;;4FAGP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACXD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"progress-chef-platform-http-interceptor.mjs","sources":["../../../projects/platform-http-interceptor/src/lib/http-auth.interceptor.ts","../../../projects/platform-http-interceptor/src/public-api.ts","../../../projects/platform-http-interceptor/src/progress-chef-platform-http-interceptor.ts"],"sourcesContent":["import {\n HttpErrorResponse, HttpEvent, HttpEventType, HttpHandler, HttpInterceptor, HttpRequest\n} from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { LocalStorageService, StorageKeys } from '@progress-chef/platform-storage-service';\nimport { ToastNotificationService } from \"@progress-chef/platform-toast-notification-service\";\nimport { Observable, catchError, finalize, tap, throwError, Subject, switchMap } from \"rxjs\";\n\n@Injectable({\n providedIn: 'root'\n})\n\nexport class HttpAuthInterceptor implements HttpInterceptor {\n authTokenSet = new Set();\n isSessionExpired = false;\n requestQueue: QueuedRequest[] = [];\n storageListenerTimer: any;\n REFRESH_TOKEN_URL = '/identity/user/jwt/refresh';\n SSO_TOKEN_URL = '/sso/api/v1/token';\n LOCAL_LOGIN_URL = '/identity/user/login';\n JWT_URL = '/identity/user/jwt';\n ORGANIZATIONS_URL = '/self/organizations';\n ROLES_URL = '/self/roles';\n APIS_TO_EXCLUDE_AUTH_HEADER = [\n '&X-Amz-Signature='\n ];\n APIS_TO_EXCLUDE_FROM_207_NOTIFICATION = [\n '/node/bulk-approve',\n '/dsm/store-service/v1/databags'\n ];\n\n APIS_TO_EXCLUDE_FROM_500_NOTIFICATION = [\n '/platform/system/v1/organization/:/create-dsm'\n ]\n\n constructor(\n private readonly router: Router,\n private readonly toastNotificationService: ToastNotificationService\n ) { }\n\n intercept(\n request: HttpRequest<unknown>,\n next: HttpHandler\n ): Observable<HttpEvent<unknown>> {\n if (!this.isTokenRefreshInProgress()) {\n return this.processHttpHandle(request, next);\n } else {\n if (request.url.includes(this.REFRESH_TOKEN_URL)) {\n LocalStorageService.setItem(StorageKeys.TOKEN_REFRESH, { \"active\": true, \"time\": new Date().getTime() });\n }\n this.startStorageListenerTimer();\n return this.createQueueRequest(request).pipe(\n switchMap((req: HttpRequest<any>) => {\n return this.processHttpHandle(req, next);\n })\n );\n }\n }\n\n isTokenRefreshInProgress(): boolean {\n return LocalStorageService.getItem(\n StorageKeys.TOKEN_REFRESH\n )?.active;\n }\n\n processQueue(): void {\n const nextRequest = this.requestQueue.shift();\n if (nextRequest) {\n nextRequest.notifier.next(nextRequest.req);\n }\n }\n\n createQueueRequest(request: HttpRequest<unknown>): Observable<any> {\n const requestObj: QueuedRequest = {} as QueuedRequest;\n requestObj.req = request;\n requestObj.notifier = new Subject<HttpRequest<any>>();\n this.requestQueue.push(requestObj);\n return requestObj.notifier.asObservable();\n }\n\n startStorageListenerTimer(): void {\n if (this.storageListenerTimer) {\n clearInterval(this.storageListenerTimer);\n }\n this.storageListenerTimer = setInterval(() => {\n if (LocalStorageService.getItem(StorageKeys.TOKEN_REFRESH) &&\n LocalStorageService.getItem(StorageKeys.TOKEN_REFRESH).active === false) {\n clearInterval(this.storageListenerTimer);\n this.processQueue();\n }\n }, 200);\n }\n\n processHttpHandle(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n let authToken = LocalStorageService.getItem(StorageKeys.AUTH_TOKEN);\n let authReq = request;\n if (authToken) {\n if (!(this.APIS_TO_EXCLUDE_AUTH_HEADER.some(url => request.url.includes(url)))) {\n authReq = request.clone({\n setHeaders: {\n Authorization: `Bearer ${authToken}`\n }\n })\n }\n if (!this.authTokenSet.has(authToken)) {\n this.isSessionExpired = false;\n }\n this.authTokenSet.add(authToken);\n }\n return next.handle(authReq).pipe(\n tap((event) => {\n if (event.type === HttpEventType.Response) {\n switch (event.status) {\n case 202:\n this.toastNotificationService.showToastNotification({\n content: event?.body?.item?.message || `Request under processing`,\n type: { style: 'info', icon: true },\n action: {}\n });\n break;\n case 207:\n if (this.APIS_TO_EXCLUDE_FROM_207_NOTIFICATION.some(url => request.url.includes(url))) {\n break;\n }\n let message = {\n content: 'Request was successful',\n notificationStyle: 'success',\n closable: false\n }\n try {\n for (let item of event.body?.items) {\n for (let err of item?.userRoleMapping) { /* Currently 207 is handled only for single use case, so it is hardcoded.If there are more use cases, then this should be updated accordingly. */\n if (err.error !== null) {\n message = {\n content: 'User not allowed for this operation',\n notificationStyle: 'error',\n closable: true\n }\n }\n }\n }\n this.toastNotificationService.showToastNotification({\n content: message.content,\n type: { style: message.notificationStyle, icon: true },\n closable: message.closable,\n action: {}\n });\n } catch (e) {\n console.log(\"Exception occurred at HttpAuthInterceptor 207 notification\", e);\n this.toastNotificationService.showToastNotification({\n content: `The request has been accepted for processing, but has been partially completed.`,\n type: { style: 'info', icon: true },\n action: {}\n });\n }\n break;\n }\n }\n }),\n catchError((error: HttpErrorResponse) => {\n const loginType = LocalStorageService.getItem(StorageKeys.LOGIN_TYPE);\n if (this.router.url.includes('/login/user-login')) {\n const skipUrls = [\n this.JWT_URL,\n this.SSO_TOKEN_URL,\n this.LOCAL_LOGIN_URL,\n this.ORGANIZATIONS_URL,\n this.ROLES_URL\n ];\n if (skipUrls.some(url => request.url.includes(url))) {\n // Skip error handling for these URLs; errors will be handled by corresponding web components\n return throwError(() => error);\n }\n }\n switch (error.status) {\n case 401:\n if (loginType === 'saml' || loginType === 'oauth') {\n LocalStorageService.removeItem(StorageKeys.USER_NAME);\n LocalStorageService.removeItem(StorageKeys.IS_REMEMBER_ME);\n }\n LocalStorageService.setItem(StorageKeys.IS_USER_ORG_AND_ROLE_SET, false);\n LocalStorageService.setItem(StorageKeys.IS_USER_AUTHENTICATED, false);\n LocalStorageService.removeItem(StorageKeys.AUTH_TOKEN);\n LocalStorageService.removeItem(StorageKeys.LOGIN_TYPE);\n LocalStorageService.removeItem(StorageKeys.IDENTITY_TOKEN);\n LocalStorageService.removeItem(StorageKeys.USER_ORG_AND_ROLE_TOKEN);\n LocalStorageService.removeItem(StorageKeys.LICENSE_DETAILS);\n\n if (this.router.url.startsWith('/login/user-login')) {\n this.handleUnauthorizedError(error);\n } else {\n this.router.navigate(['/login']).then((navigated) => {\n if (navigated) {\n this.handleUnauthorizedError(error);\n }\n })\n }\n break;\n case 402:\n if (loginType === 'saml' || loginType === 'oauth') {\n LocalStorageService.removeItem(StorageKeys.USER_NAME);\n LocalStorageService.removeItem(StorageKeys.IS_REMEMBER_ME);\n }\n LocalStorageService.setItem(StorageKeys.IS_USER_ORG_AND_ROLE_SET, false);\n LocalStorageService.setItem(StorageKeys.IS_USER_AUTHENTICATED, false);\n LocalStorageService.removeItem(StorageKeys.AUTH_TOKEN);\n LocalStorageService.removeItem(StorageKeys.LOGIN_TYPE);\n LocalStorageService.removeItem(StorageKeys.IDENTITY_TOKEN);\n LocalStorageService.removeItem(StorageKeys.USER_ORG_AND_ROLE_TOKEN);\n LocalStorageService.removeItem(StorageKeys.LICENSE_DETAILS);\n\n this.router.navigate(['/login']).then((navigated) => {\n if (navigated) {\n this.toastNotificationService.showToastNotification({\n content: `License expired, please contact your support representative.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n })\n break;\n case 403:\n try {\n for (let err of error.error.errors) {\n const message = err?.message?.toLowerCase();\n const content = message?.includes('one time password') && message?.includes('expired')\n ? 'One Time Password entered has already expired.'\n : 'This operation is not permitted for the current role.';\n\n this.toastNotificationService.showToastNotification({\n content,\n type: { style: 'error', icon: true },\n closable: true,\n action: {},\n });\n }\n } catch (e) {\n console.log(\"HttpAuthInterceptor: Exception occurred at 403\", e);\n this.toastNotificationService.showToastNotification({\n content: `This operation is not permitted for the current role.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n break;\n case 405:\n try {\n for (let err of error.error.errors) {\n this.toastNotificationService.showToastNotification({\n content: err?.reason || `HTTP method not allowed.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n } catch (e) {\n console.log(\"HttpAuthInterceptor: Exception occurred at 405\", e);\n this.toastNotificationService.showToastNotification({\n content: `HTTP method not allowed.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n break;\n case 500:\n if (this.APIS_TO_EXCLUDE_FROM_500_NOTIFICATION.some(url => {\n if (url.includes(':')) {\n const urlParts = url.split(':');\n return request.url.includes(urlParts[0]) && request.url.includes(urlParts[1]);\n }\n return request.url.includes(url);\n })) {\n break;\n }\n try {\n for (let err of error?.error?.errors) {\n this.toastNotificationService.showToastNotification({\n content: err?.message || `Something went wrong. Please try again.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n } catch (e) {\n console.log(\"HttpAuthInterceptor: Exception occurred at 500\", e);\n this.toastNotificationService.showToastNotification({\n content: `Something went wrong. Please try again.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n break;\n case 502:\n this.toastNotificationService.showToastNotification({\n content: `Bad Gateway. Please try again.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n break;\n case 503:\n this.toastNotificationService.showToastNotification({\n content: `Service Unavailable. Please try again.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n break;\n case 0:\n case 504:\n this.toastNotificationService.showToastNotification({\n content: `Unable to reach server. Please try again.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n break;\n\n }\n return throwError(() => error);\n }),\n finalize(() => {\n if (!this.isTokenRefreshInProgress()) {\n this.processQueue(); // Process next request in the queue\n }\n })\n );\n }\n\n handleUnauthorizedError(error: HttpErrorResponse) {\n try {\n for (let err of error?.error?.errors) {\n let message = '';\n if (err?.message.toLowerCase() === 'invalid credentials') {\n message = 'Invalid username or password.';\n } else if (err?.message.includes('expired')) {\n message = 'Your session has expired. Please login again.';\n }\n this.toastNotificationService.showToastNotification({\n content: message || err?.message || `Unauthorized`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n } catch (e) {\n console.log(\"HttpAuthInterceptor: Exception occurred at 401\", e);\n this.toastNotificationService.showToastNotification({\n content: `Something went wrong. Please try again.`,\n type: { style: 'error', icon: true },\n closable: true,\n action: {}\n });\n }\n }\n}\n\ninterface QueuedRequest {\n req: HttpRequest<any>;\n notifier: Subject<any>;\n}\n","/*\n * Public API Surface of platform-http-interceptor\n */\n\nexport * from './lib/http-auth.interceptor';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAaa,mBAAmB,CAAA;IAuB9B,WAAA,CACmB,MAAc,EACd,wBAAkD,EAAA;QADlD,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,wBAAwB,GAAxB,wBAAwB;AAxB3C,QAAA,IAAA,CAAA,YAAY,GAAG,IA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A,EAAA,EAAA,CAAA,MAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,wBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAHlB,MAAM,EAAA,CAAA,CAAA;;4FAGP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACXD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -18,6 +18,7 @@ export declare class HttpAuthInterceptor implements HttpInterceptor {
18
18
  ROLES_URL: string;
19
19
  APIS_TO_EXCLUDE_AUTH_HEADER: string[];
20
20
  APIS_TO_EXCLUDE_FROM_207_NOTIFICATION: string[];
21
+ APIS_TO_EXCLUDE_FROM_500_NOTIFICATION: string[];
21
22
  constructor(router: Router, toastNotificationService: ToastNotificationService);
22
23
  intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
23
24
  isTokenRefreshInProgress(): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress-chef/platform-http-interceptor",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.2.17",
6
6
  "@angular/core": "^19.2.17",