|
@@ -55,7 +55,7 @@ func NewStore(cache cache.Repo, ttl time.Duration, namespace string) base64Captc
|
|
var _ Captcha = (*captcha)(nil)
|
|
var _ Captcha = (*captcha)(nil)
|
|
|
|
|
|
type Captcha interface {
|
|
type Captcha interface {
|
|
- Generate() (id, b64s string, err error)
|
|
|
|
|
|
+ Generate() (id, b64s, answer string, err error)
|
|
Verify(id, value string) bool
|
|
Verify(id, value string) bool
|
|
}
|
|
}
|
|
|
|
|
|
@@ -87,7 +87,7 @@ func NewDigitCaptcha(store base64Captcha.Store, height, width, length int) Captc
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-func (c *captcha) Generate() (id, b64s string, err error) {
|
|
|
|
|
|
+func (c *captcha) Generate() (id, b64s, answer string, err error) {
|
|
newCaptcha := base64Captcha.NewCaptcha(c.driver, c.store)
|
|
newCaptcha := base64Captcha.NewCaptcha(c.driver, c.store)
|
|
return newCaptcha.Generate()
|
|
return newCaptcha.Generate()
|
|
}
|
|
}
|