
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
vue-middleware
Advanced tools
Vue middleware is a powerful Vuejs plugin for creating custom middleware and manage roles and permissions easily.
vue-middleware is a powerful Vuejs plugin for creating custom middleware, similar to what you find in Nuxt apps but with extra features for roles and permissions.
It helps you manage who can access which parts of your app especially when it comes to different route-based roles or permissions using a nice driver-approach making it great with integrating other backend frameworks, for more information please visit the offical documentation.
Out of the box it makes it super easy to handle Laravel roles and permissions without needing to set up a bunch of stuff using zero-config driver.
Follow these steps to quickly install vue-middleware into your project, in this example we're using npm.
npm i vue-middleware
Let's create a simple middleware for protecting our dashboard.
In main.ts we're goning to register our first dashboard middleware the function receives all the parameters you might think of in the authentication process.
import { createApp, App } from 'vue'
import { vueMiddleware, MiddlewareContext } from 'vue-middleware'
import App from './App.vue'
const app: App = createApp(App)
app.use(vueMiddleware, {
middleware: {
dashboard: ({ app, router, from, to, redirect, abort, guard }: MiddlewareContext) => {
//
},
},
})
app.mount('#app')
In vue-router routes we need to attach this middleware name in a route.
export const routes = [
{
name: 'dashboard',
path: '/dashboard',
component: () => import('@/layouts/dashboard.vue'),
meta: {
middleware: 'dashboard', // This dashboard and its children are now guarded using the dashboard middleware
},
children: [
{
name: 'dashboard_home',
path: '',
component: () => import('@/pages/dashboard/index.vue'),
},
{
name: 'dashboard_users',
path: 'users',
component: () => import('@/pages/dashboard/users.vue'),
},
]
}
]
FAQs
Vue middleware is a powerful Vuejs plugin for creating custom middleware and manage roles and permissions easily.
The npm package vue-middleware receives a total of 52 weekly downloads. As such, vue-middleware popularity was classified as not popular.
We found that vue-middleware demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.