diff --git a/captcha.go b/captcha.go index 80f55e7..bda1600 100644 --- a/captcha.go +++ b/captcha.go @@ -1,13 +1,7 @@ package contracts -import ( - "net/http" - - "github.com/samber/do" -) - type Captcha interface { - HttpMiddleware(container *do.Injector) func(next http.Handler) http.Handler + RouteMiddleware Verify(id int64, answer string, clear bool) error Generate(captchaUuid, recipient, ip string, u User) (body string, id int64, err error) } diff --git a/routing.go b/routing.go index 847db61..31fd316 100644 --- a/routing.go +++ b/routing.go @@ -70,6 +70,10 @@ type Route interface { MakeRequest(r *http.Request, params map[string]any) (*http.Request, error) } +type RouteMiddleware interface { + HttpMiddleware(r Route) func(next http.Handler) http.Handler +} + type WsClientGroup string type WsClientID uint