developmentseed / developmentseed/bones-auth

recaptcha verification kludge

Open
#13 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
17
Forks
1
PR merge metrics
No merged PRs in 30d

Description

I just committed [a conditional inclusion of the bones-recaptcha middleware](https://github.com/developmentseed/bones-auth/commit/14fc04418e9b0695eb84b5bdf73401c728c16074).

While I tried to keep this out of bones-auth entirely, the current way that the servers are structured make it impossible to inject the middleware into the correct place without overriding the entire auth stack.

The recaptcha check needs to occurr after the base middleware server has been initialized, which gives us the bodyDecoder and req.body. Because the Auth server is [mounted on the middleware server](https://github.com/developmentseed/bones-auth/blob/master/servers/Middleware.bones), this check needs to happen inside an Auth server.

The wrinkle here comes in with [AuthResetPassword.bones](https://github.com/developmentseed/bones-auth/blob/master/servers/AuthResetPassword.bones), which is not a server in an of itself, but instead extends the Auth server. This is needed because the session handling is all done via properties on the Auth server, and it needs access to these to be able to function.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.