@mapomodule/core
Advanced tools
Comparing version 1.0.0-alpha.18 to 1.0.0-alpha.19
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.0.0-alpha.19](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.18...v1.0.0-alpha.19) (2022-04-06) | ||
### Bug Fixes | ||
* fix logout loop ([3177cca](https://github.com/lotrekagency/mapo/commit/3177ccaf4be6151feec379c4241f8784b79d4361)) | ||
# [1.0.0-alpha.18](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.17...v1.0.0-alpha.18) (2022-04-04) | ||
@@ -8,0 +19,0 @@ |
module.exports = ({ $axios, store }) => { | ||
if ($axios && store){ | ||
if ($axios && store) { | ||
$axios.onRequest((config) => { | ||
@@ -10,3 +10,3 @@ const token = store.getters['mapo/user/token'] | ||
}) | ||
$axios.onResponse((response) => { | ||
@@ -24,3 +24,5 @@ if (response.status === 401) { | ||
const { status, request } = error.response || {} | ||
if (status === 401 && (request || {}).path !== '/api/auth/logout') { | ||
const baseURL = ($axios.defaults.baseURL || "").replace(/https?:\/\/[^\/]+/i, "") | ||
const logoutPath = `${baseURL.endsWith("/") ? baseURL : baseURL + "/"}${process.env.AUTH_LOGIN_URL || "api/auth/logout"}` | ||
if (status === 401 && (request || {}).path !== logoutPath) { | ||
store.dispatch('mapo/user/logout') | ||
@@ -27,0 +29,0 @@ } |
{ | ||
"name": "@mapomodule/core", | ||
"version": "1.0.0-alpha.18", | ||
"version": "1.0.0-alpha.19", | ||
"description": "This is part of Mapo nuxt module. Injects the core mapo plugin helpers.", | ||
@@ -21,3 +21,3 @@ "author": "bnznamco <gabriele.baldi.01@gmail.com>", | ||
}, | ||
"gitHead": "1b05e625339b6ee6ed0e238739cc31fbd84f3397" | ||
"gitHead": "3bc598b7ecb64c67a164b438847eb237f78efc75" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25117
386