muffin-admin 1.44.2 → 1.44.4
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.
- package/dist/cjs/authprovider.js +21 -6
- package/dist/esm/authprovider.js +21 -6
- package/package.json +13 -13
- package/src/authprovider.js +3 -3
package/dist/cjs/authprovider.js
CHANGED
|
@@ -98,11 +98,11 @@ var _default = function _default(props) {
|
|
|
98
98
|
}(),
|
|
99
99
|
checkError: function () {
|
|
100
100
|
var _checkError = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(error) {
|
|
101
|
-
var status;
|
|
101
|
+
var _ref4, status;
|
|
102
102
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
103
103
|
while (1) switch (_context3.prev = _context3.next) {
|
|
104
104
|
case 0:
|
|
105
|
-
status =
|
|
105
|
+
_ref4 = error || {}, status = _ref4.status;
|
|
106
106
|
if (!(status == 401 || status == 403)) {
|
|
107
107
|
_context3.next = 4;
|
|
108
108
|
break;
|
|
@@ -190,10 +190,25 @@ var _default = function _default(props) {
|
|
|
190
190
|
return logout;
|
|
191
191
|
}(),
|
|
192
192
|
getIdentity: getIdentity,
|
|
193
|
-
getPermissions: function
|
|
194
|
-
var
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
getPermissions: function () {
|
|
194
|
+
var _getPermissions = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
|
195
|
+
var role;
|
|
196
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
197
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
198
|
+
case 0:
|
|
199
|
+
role = authGet(storage_name + "_role");
|
|
200
|
+
return _context6.abrupt("return", role || "");
|
|
201
|
+
case 2:
|
|
202
|
+
case "end":
|
|
203
|
+
return _context6.stop();
|
|
204
|
+
}
|
|
205
|
+
}, _callee6);
|
|
206
|
+
}));
|
|
207
|
+
function getPermissions() {
|
|
208
|
+
return _getPermissions.apply(this, arguments);
|
|
209
|
+
}
|
|
210
|
+
return getPermissions;
|
|
211
|
+
}()
|
|
197
212
|
};
|
|
198
213
|
};
|
|
199
214
|
exports["default"] = _default;
|
package/dist/esm/authprovider.js
CHANGED
|
@@ -91,11 +91,11 @@ export default (function (props) {
|
|
|
91
91
|
}(),
|
|
92
92
|
checkError: function () {
|
|
93
93
|
var _checkError = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(error) {
|
|
94
|
-
var status;
|
|
94
|
+
var _ref4, status;
|
|
95
95
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
96
96
|
while (1) switch (_context3.prev = _context3.next) {
|
|
97
97
|
case 0:
|
|
98
|
-
status =
|
|
98
|
+
_ref4 = error || {}, status = _ref4.status;
|
|
99
99
|
if (!(status == 401 || status == 403)) {
|
|
100
100
|
_context3.next = 4;
|
|
101
101
|
break;
|
|
@@ -183,9 +183,24 @@ export default (function (props) {
|
|
|
183
183
|
return logout;
|
|
184
184
|
}(),
|
|
185
185
|
getIdentity: getIdentity,
|
|
186
|
-
getPermissions: function
|
|
187
|
-
var
|
|
188
|
-
|
|
189
|
-
|
|
186
|
+
getPermissions: function () {
|
|
187
|
+
var _getPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
188
|
+
var role;
|
|
189
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
190
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
191
|
+
case 0:
|
|
192
|
+
role = authGet(storage_name + "_role");
|
|
193
|
+
return _context6.abrupt("return", role || "");
|
|
194
|
+
case 2:
|
|
195
|
+
case "end":
|
|
196
|
+
return _context6.stop();
|
|
197
|
+
}
|
|
198
|
+
}, _callee6);
|
|
199
|
+
}));
|
|
200
|
+
function getPermissions() {
|
|
201
|
+
return _getPermissions.apply(this, arguments);
|
|
202
|
+
}
|
|
203
|
+
return getPermissions;
|
|
204
|
+
}()
|
|
190
205
|
};
|
|
191
206
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muffin-admin",
|
|
3
|
-
"version": "1.44.
|
|
3
|
+
"version": "1.44.4",
|
|
4
4
|
"description": "NPM package for https://github.com/klen/muffin-admin",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -22,25 +22,25 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://github.com/klen/muffin-admin#readme",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@mui/icons-material": "^5.
|
|
26
|
-
"@mui/material": "^5.
|
|
25
|
+
"@mui/icons-material": "^5.14.1",
|
|
26
|
+
"@mui/material": "^5.14.2",
|
|
27
27
|
"js-cookie": "^3.0.5",
|
|
28
|
-
"ra-ui-materialui": "^4.
|
|
28
|
+
"ra-ui-materialui": "^4.12.2",
|
|
29
29
|
"react": "^18.2.0",
|
|
30
|
-
"react-admin": "^4.
|
|
30
|
+
"react-admin": "^4.12.2",
|
|
31
31
|
"react-dom": "^18.2.0",
|
|
32
32
|
"validator": "^13.9.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@babel/cli": "^7.22.
|
|
36
|
-
"@babel/core": "^7.22.
|
|
37
|
-
"@babel/eslint-parser": "^7.22.
|
|
38
|
-
"@babel/plugin-transform-runtime": "^7.22.
|
|
39
|
-
"@babel/preset-env": "^7.22.
|
|
35
|
+
"@babel/cli": "^7.22.9",
|
|
36
|
+
"@babel/core": "^7.22.9",
|
|
37
|
+
"@babel/eslint-parser": "^7.22.9",
|
|
38
|
+
"@babel/plugin-transform-runtime": "^7.22.9",
|
|
39
|
+
"@babel/preset-env": "^7.22.9",
|
|
40
40
|
"@babel/preset-react": "^7.22.5",
|
|
41
|
-
"babel-loader": "^9.1.
|
|
42
|
-
"eslint-plugin-react": "^7.
|
|
43
|
-
"webpack": "^5.88.
|
|
41
|
+
"babel-loader": "^9.1.3",
|
|
42
|
+
"eslint-plugin-react": "^7.33.0",
|
|
43
|
+
"webpack": "^5.88.2",
|
|
44
44
|
"webpack-cli": "^5.1.4",
|
|
45
45
|
"webpack-dev-server": "^4.15.1"
|
|
46
46
|
}
|
package/src/authprovider.js
CHANGED
|
@@ -42,7 +42,7 @@ export default (props) => {
|
|
|
42
42
|
},
|
|
43
43
|
|
|
44
44
|
checkError: async (error) => {
|
|
45
|
-
const { status } = error
|
|
45
|
+
const { status } = error || {}
|
|
46
46
|
|
|
47
47
|
if (status == 401 || status == 403) {
|
|
48
48
|
// Clean storage
|
|
@@ -77,9 +77,9 @@ export default (props) => {
|
|
|
77
77
|
|
|
78
78
|
getIdentity,
|
|
79
79
|
|
|
80
|
-
getPermissions: () => {
|
|
80
|
+
getPermissions: async () => {
|
|
81
81
|
const role = authGet(storage_name + "_role")
|
|
82
|
-
return role
|
|
82
|
+
return role || ""
|
|
83
83
|
},
|
|
84
84
|
}
|
|
85
85
|
}
|