Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add addRouteMiddleware test #827

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

wattanx
Copy link
Collaborator

@wattanx wattanx commented Jun 23, 2023

πŸ”— Linked issue

❓ 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

I would like to add addRouteMiddleware as it was not tested.

πŸ“ Checklist

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

@wattanx
Copy link
Collaborator Author

wattanx commented Jun 23, 2023

@danielroe
Is the following usage of defineNuxtRouteMiddleware acceptable?
We would like to consider not supporting it because we think it would be difficult to support it in Nuxt Bridge.
(Because it would have to be converted to Nuxt 2 middleware.)

const authMiddleware = defineNuxtRouteMiddleware((to, from) => {
  ...
});

export default defineNuxtPlugin((_nuxt) => {
  addRouteMiddleware('auth', authMiddleware, { global: true })
})

@danielroe
Copy link
Member

I would be happy to add a note that this is not supported (if we can't) πŸ‘

@danielroe danielroe changed the title feat: add addRouteMiddleware test feat: add addRouteMiddleware test Jun 23, 2023
@danielroe danielroe merged commit 9b0a98e into nuxt:main Jun 23, 2023
@wattanx
Copy link
Collaborator Author

wattanx commented Jun 23, 2023

Thanks!
I added documentation on defineNuxtRouteMiddleware and stated that it is not supported.
nuxt/nuxt#21718

@danielroe danielroe mentioned this pull request Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants