Skip to content

Commit

Permalink
fix(kit): don't warn if middleware is added twice
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Feb 26, 2024
1 parent 196223c commit 08b656a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/kit/src/pages.ts
Expand Up @@ -51,6 +51,7 @@ export function addRouteMiddleware (input: NuxtMiddleware | NuxtMiddleware[], op
for (const middleware of middlewares) {
const find = app.middleware.findIndex(item => item.name === middleware.name)
if (find >= 0) {
if (app.middleware[find].path === middleware.path) { continue }
if (options.override === true) {
app.middleware[find] = middleware
} else {
Expand Down

0 comments on commit 08b656a

Please sign in to comment.