@qlibs/utils 1.14.5 → 1.14.7

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.
@@ -58,9 +58,24 @@ function handleNoAuth(errorResponse, Modal) {
58
58
  if (errorResponse.status === 403) {
59
59
  title = 'Forbidden';
60
60
  content = `You don't have permission. Please contact administrator.`;
61
+ Modal.error({
62
+ className: 'noauth_401403',
63
+ title,
64
+ content,
65
+ footer: null,
66
+ });
67
+ setTimeout(() => {
68
+ Modal.destroyAll();
69
+ if (window.location.pathname.includes('my-')) {
70
+ window.location.href = '/my-dashboard';
71
+ }
72
+ else {
73
+ window.location.href = '/dashboard';
74
+ }
75
+ }, 1000);
61
76
  }
62
77
  else if (errorResponse.status === 401) {
63
- title = 'Unauthorized';
78
+ title = 'Login Required';
64
79
  content = `Please login to continue`;
65
80
  }
66
81
  else if (((_b = errorResponse.data) === null || _b === void 0 ? void 0 : _b.code) === 'err_unauthorized') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qlibs/utils",
3
- "version": "1.14.5",
3
+ "version": "1.14.7",
4
4
  "description": "",
5
5
  "author": "QBIT Developer",
6
6
  "license": "MIT",