Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(nuxt): don't short circuit middleware after validate function #9180

Merged

Conversation

huang-julien
Copy link
Member

@huang-julien huang-julien commented Nov 18, 2022

πŸ”— Linked issue

resolve nuxt/nuxt#15539
resolve nuxt/nuxt#15650

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Hi πŸ‘‹ this PR moves the validate() function of the page meta to be ran after the global middleware and the component middleware.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox
Copy link

codesandbox bot commented Nov 18, 2022

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@pi0 pi0 requested a review from danielroe November 21, 2022 10:51
Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very nice catch - thank you. I think we don't need to change the order of the middleware, but just ensure that we don't short-circuit the rest of them, but please do let me know if there was another reason you moved it to the end of the middleware stack. πŸ™

@danielroe danielroe changed the title fix(nuxt): run page meta validate after global and component middleware fix(nuxt): don't short circuit middleware after validate function Jan 14, 2023
@danielroe danielroe merged commit f4ba7ec into nuxt:main Jan 14, 2023
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe mentioned this pull request Jan 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

route middleware and route validation can't work together definePageMeta breaks global middleware
2 participants