Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mapomodule/core

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapomodule/core - npm Package Compare versions

Comparing version 1.0.0-alpha.30 to 1.0.0-alpha.31

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

# [1.0.0-alpha.31](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.30...v1.0.0-alpha.31) (2022-09-14)
### Bug Fixes
* **interceptor:** remove token injection for axios requests ([59b2f5c](https://github.com/lotrekagency/mapo/commit/59b2f5cb3dfd0becd78df02f30bc32967643e276))
* **middleware:** fix auth middleware to correclty redirect based on router base ([1d49cd7](https://github.com/lotrekagency/mapo/commit/1d49cd72e141888ef7aae91ac0ddb13f8d0fce7a))
# [1.0.0-alpha.30](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.29...v1.0.0-alpha.30) (2022-09-13)

@@ -8,0 +20,0 @@

8

interceptor/auth.js
module.exports = ({ $axios, store }) => {
if ($axios && store) {
$axios.onRequest((config) => {
const token = store.getters['mapo/user/token']
if (token && token !== 'undefined') {
config.headers['Authorization'] = `Token ${token}`
}
return config
})
$axios.onResponse((response) => {

@@ -12,0 +4,0 @@ if (response.status === 401) {

import Middleware from '../../middleware' // little hack to inject middleware in root project :P
Middleware.auth = Middleware.auth || function ({ route, redirect, query, store }) {
Middleware.auth = Middleware.auth || function ({ route, redirect, query, store, app }) {
const { router: { options } } = app;
const isLoggedIn = store.getters['mapo/user/isLoggedIn']
if (!isLoggedIn) {
query['redirect'] = route.path
return redirect('/login', query)
return redirect(`${options.base || '/'}login`, query)
}
}

4

package.json
{
"name": "@mapomodule/core",
"version": "1.0.0-alpha.30",
"version": "1.0.0-alpha.31",
"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": "f648aac2fc02b28e687f4631cfbaf4cde6999a8b"
"gitHead": "fe25f51c0ef03764bca9d9b2b123f0729d71d13e"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc