fix: move ALTCHA challenge endpoint outside rate limiting middleware

- Separate ALTCHA challenge from rate-limited auth group
- Register ALTCHA challenge directly on v1 router
- This should resolve the route registration issue
This commit is contained in:
Patrick Britton 2026-02-16 22:44:17 -06:00
parent 45a7655f88
commit e1f32cec13

View file

@ -250,7 +250,6 @@ func main() {
} }
auth := v1.Group("/auth") auth := v1.Group("/auth")
auth.Use(middleware.RateLimit(0.5, 3))
{ {
auth.POST("/register", authHandler.Register) auth.POST("/register", authHandler.Register)
auth.POST("/signup", authHandler.Register) auth.POST("/signup", authHandler.Register)
@ -260,9 +259,11 @@ func main() {
auth.GET("/verify", authHandler.VerifyEmail) auth.GET("/verify", authHandler.VerifyEmail)
auth.POST("/forgot-password", authHandler.ForgotPassword) auth.POST("/forgot-password", authHandler.ForgotPassword)
auth.POST("/reset-password", authHandler.ResetPassword) auth.POST("/reset-password", authHandler.ResetPassword)
auth.GET("/altcha-challenge", authHandler.GetAltchaChallenge)
} }
// ALTCHA challenge endpoint (no rate limiting)
v1.GET("/auth/altcha-challenge", authHandler.GetAltchaChallenge)
authorized := v1.Group("") authorized := v1.Group("")
authorized.Use(middleware.AuthMiddleware(cfg.JWTSecret, dbPool)) authorized.Use(middleware.AuthMiddleware(cfg.JWTSecret, dbPool))
{ {