diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 1e58ecf..02a9854 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -6,20 +6,16 @@ import ( "justcaptcha/internal/captcha" "justcaptcha/pkg/server" "net/http" - "time" ) -type CaptchaHandlers struct { - ExpireIn time.Duration -} +type CaptchaHandlers struct{} -func New(expiration time.Duration) *CaptchaHandlers { - return &CaptchaHandlers{ - ExpireIn: expiration} +func New() *CaptchaHandlers { + return &CaptchaHandlers{} } func (h *CaptchaHandlers) New(w http.ResponseWriter, r *http.Request) { - dc := captcha.NewDwellingCaptcha(h.ExpireIn) + dc := captcha.NewDwellingCaptcha(captcha.GetExpireInterval()) _, id := captcha.New(r.RemoteAddr, dc) fmt.Fprint(w, id)