@mapomodule/core 1.0.0-alpha.30 → 1.0.0-alpha.34

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 CHANGED
@@ -3,6 +3,29 @@
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.34](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.33...v1.0.0-alpha.34) (2022-11-11)
7
+
8
+
9
+ ### Features
10
+
11
+ * default upload in multipart autodiscover ([b153307](https://github.com/lotrekagency/mapo/commit/b15330725a64a0931d2de49929a01e3a7319b382))
12
+
13
+
14
+
15
+
16
+
17
+ # [1.0.0-alpha.31](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.30...v1.0.0-alpha.31) (2022-09-14)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **interceptor:** remove token injection for axios requests ([59b2f5c](https://github.com/lotrekagency/mapo/commit/59b2f5cb3dfd0becd78df02f30bc32967643e276))
23
+ * **middleware:** fix auth middleware to correclty redirect based on router base ([1d49cd7](https://github.com/lotrekagency/mapo/commit/1d49cd72e141888ef7aae91ac0ddb13f8d0fce7a))
24
+
25
+
26
+
27
+
28
+
6
29
  # [1.0.0-alpha.30](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.29...v1.0.0-alpha.30) (2022-09-13)
7
30
 
8
31
  **Note:** Version bump only for package @mapomodule/core
package/api/crud.js CHANGED
@@ -2,8 +2,8 @@ const transformRequestInMultipart = require('@mapomodule/core/api/multipart')
2
2
  const trimslashes = (str) => (str || "").replace(/^\/|\/$/g, '')
3
3
  const preparePayload = (payload, options) => {
4
4
  const { multipart } = (options || {})
5
- if (!(payload instanceof FormData) && (typeof multipart === 'string') && multipart !== 'disable') {
6
- payload = transformRequestInMultipart(payload, multipart);
5
+ if (!(payload instanceof FormData) && multipart !== 'disable') {
6
+ payload = transformRequestInMultipart(payload, multipart || 'auto');
7
7
  }
8
8
  return payload
9
9
  }
@@ -1,13 +1,5 @@
1
1
  module.exports = ({ $axios, store }) => {
2
2
  if ($axios && store) {
3
- $axios.onRequest((config) => {
4
- const token = store.getters['mapo/user/token']
5
- if (token && token !== 'undefined') {
6
- config.headers['Authorization'] = `Token ${token}`
7
- }
8
- return config
9
- })
10
-
11
3
  $axios.onResponse((response) => {
12
4
  if (response.status === 401) {
13
5
  store.dispatch('mapo/user/logout');
@@ -1,9 +1,10 @@
1
1
  import Middleware from '../../middleware' // little hack to inject middleware in root project :P
2
2
 
3
- Middleware.auth = Middleware.auth || function ({ route, redirect, query, store }) {
3
+ Middleware.auth = Middleware.auth || function ({ route, redirect, query, store, app }) {
4
+ const { router: { options } } = app;
4
5
  const isLoggedIn = store.getters['mapo/user/isLoggedIn']
5
6
  if (!isLoggedIn) {
6
7
  query['redirect'] = route.path
7
- return redirect('/login', query)
8
+ return redirect(`${options.base || '/'}login`, query)
8
9
  }
9
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapomodule/core",
3
- "version": "1.0.0-alpha.30",
3
+ "version": "1.0.0-alpha.34",
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": [
@@ -13,10 +13,10 @@
13
13
  "repository": "https://github.com/lotrekagency/mapo",
14
14
  "main": "./module.js",
15
15
  "dependencies": {
16
- "@mapomodule/utils": "^1.0.0-alpha.30"
16
+ "@mapomodule/utils": "^1.0.0-alpha.34"
17
17
  },
18
18
  "publishConfig": {
19
19
  "access": "public"
20
20
  },
21
- "gitHead": "f648aac2fc02b28e687f4631cfbaf4cde6999a8b"
21
+ "gitHead": "48d74634c57ecbdf8c0b65a11833050c068fa9ef"
22
22
  }