Skip to content

Demo chaining of middlewares#62

Open
eric-burel wants to merge 1 commit intoamorey:mainfrom
eric-burel:patch-1
Open

Demo chaining of middlewares#62
eric-burel wants to merge 1 commit intoamorey:mainfrom
eric-burel:patch-1

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
Owner

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

Comments