Expiration time now being get from CaptchaDB.
This commit is contained in:
parent
c5d159531c
commit
4af8d67299
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user