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

Demo chaining of middlewares #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eric-burel
Copy link

It's not obvious how to mix csrfMiddleware with additional logic in an Edge middleware (while trying it out, I forgot the "await" for instance). This version is more explicit about how to mix csrfMiddleware with custom logic.

It's not obvious how to mix csrfMiddleware with additional logic in an Edge middleware (while trying it out, I forgot the "await" for instance). This version is more explicit about how to mix csrfMiddleware with custom logic.
@amorey
Copy link
Member

amorey commented Sep 19, 2024

Thanks for the suggestion! It would definitely be helpful to add an example of how to chain middleware.

In terms of how to mix edge-csrf with custom logic, there's an example further down the page under the heading "Lower-level implementations":
https://github.com/kubetail-org/edge-csrf/tree/main/packages/nextjs#lower-level-implementations

Does that address the use case of how to mix edge-csrf with additional logic?

How did you actually chain your middleware functions together? I think it would be helpful to add a new section specifically about chaining middleware with some examples.

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