-
Notifications
You must be signed in to change notification settings - Fork 36
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
Captcha in forms #204
Captcha in forms #204
Conversation
dd8b5ff
to
0a3ecf1
Compare
@pettinarip LGTM, great work! 🎉 Haven't approved yet because maybe the middleware logic can be abstracted using Next's middleware (and maybe it can even help to avoid extending |
@nhsz yes, I think I didn't use it because I thought it was meant to be used only on server side requests but not on API routes since you have a Also there are a couple of official docs talking about how to use middlewares on the api routes:
I guess those docs are a bit old and we could refactor it using the new _middleware files, I like that more. Will try to see to do the refactor. Only concern right now is that the _middleware file is applied to all the files in the folder....it doesn't let you choose which middleware you want to apply to each route within the folder. E.g. I want to only apply the But I guess that overall, I like that approach more than the current solution. Let me work on that and I'll let you know. |
Agree. You can apply the middleware to certain routes only https://nextjs.org/docs/middleware#execution-order, so maybe nesting the Regarding extending |
You mean having something like this:
The problem with that is that I need to apply the parsing before the captcha check in this case. I think I will go with just one |
I'm having some troubles querying I've upgraded Next to Then Given these conditions I would say to skip this refactor for now. |
Description
Adds hCaptcha to forms.
TODO
#198