Skip to content
Snippets Groups Projects
Commit 657980e0 authored by Ophestra's avatar Ophestra
Browse files

Merge branch 'hcaptcha-middleware-order' into 'main'

fix(api): move captcha handler in front of registration handler

See merge request !13
parents bd42dce4 21cfaad5
Branches main
No related tags found
1 merge request!13fix(api): move captcha handler in front of registration handler
Pipeline #996 passed
......@@ -19,7 +19,7 @@ type registration struct {
// Waitlist registration route
func routeRegister(app *fiber.App, p string, db *leveldb.DB, count *atomic.Uint64, captcha fiber.Handler) {
app.Post(p, rateLimiter(), func(c fiber.Ctx) error {
app.Post(p, rateLimiter(), captcha, func(c fiber.Ctx) error {
t := time.Now().UTC()
req := new(registration)
......@@ -68,5 +68,5 @@ func routeRegister(app *fiber.App, p string, db *leveldb.DB, count *atomic.Uint6
log.Printf("registered email %q", req.Email)
count.Add(1)
return c.JSON(newMessage(true, "Email registered successfully"))
}, captcha)
})
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment