@mapomodule/core 1.0.0-alpha.16 → 1.0.0-alpha.17
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/CHANGELOG.md +11 -0
- package/interceptor/auth.js +3 -3
- package/middleware/permissions.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.0.0-alpha.17](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.16...v1.0.0-alpha.17) (2022-04-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* various fixes to auth loops ([58cdb58](https://github.com/lotrekagency/mapo/commit/58cdb586e88df8e595876ba4dd4d4cc11865f7e3))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [1.0.0-alpha.16](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.15...v1.0.0-alpha.16) (2022-04-03)
|
|
7
18
|
|
|
8
19
|
|
package/interceptor/auth.js
CHANGED
|
@@ -19,9 +19,9 @@ module.exports = ({ $axios, store }) => {
|
|
|
19
19
|
})
|
|
20
20
|
|
|
21
21
|
$axios.onError((error) => {
|
|
22
|
-
const { status } = error.response || {}
|
|
23
|
-
if (status === 401) {
|
|
24
|
-
store.dispatch('mapo/user/logout')
|
|
22
|
+
const { status, request } = error.response || {}
|
|
23
|
+
if (status === 401 && request?.path !== '/api/auth/logout') {
|
|
24
|
+
store.dispatch('mapo/user/logout')
|
|
25
25
|
}
|
|
26
26
|
if (status == 403) {
|
|
27
27
|
store.dispatch("mapo/app/showSnackMessage", { message: "Permission denied..", color: "error" })
|
|
@@ -9,7 +9,7 @@ Middleware.permissions = Middleware.permissions || async function ({ route, erro
|
|
|
9
9
|
return
|
|
10
10
|
}
|
|
11
11
|
const { model } = route.meta.permissions
|
|
12
|
-
const userPermission = userInfo.user_permissions.filter(perm => perm.codename.endsWith(model)).map(({ codename }) => codename.replace(`_${model}`, ''))
|
|
12
|
+
const userPermission = (userInfo.user_permissions || []).filter(perm => perm.codename.endsWith(model)).map(({ codename }) => codename.replace(`_${model}`, ''))
|
|
13
13
|
if (!userPermission.includes('view')) {
|
|
14
14
|
return error({ statusCode: 404, message: 'This page could not be found' })
|
|
15
15
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapomodule/core",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.17",
|
|
4
4
|
"description": "This is part of Mapo nuxt module. Injects the core mapo plugin helpers.",
|
|
5
5
|
"author": "bnznamco <gabriele.baldi.01@gmail.com>",
|
|
6
6
|
"keywords": [
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"publishConfig": {
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "abd0d72a2d294acfde87af3a6f3fa3c19f100b30"
|
|
22
22
|
}
|