Closed Nappy-Says closed 2 years ago
On these lines:
digits := captcha.RandomDigits(6)
w = captcha.NewImage(id, digits, 256, 128)
You just create new random digits unrelated to the captcha ID that you generated. To generate an image with the actual digits that get stored in the global store when you call captcha.New
, use:
captcha.WriteImage(w, id, 256, 128)
Here's how it's implemented.
I was advised by a colleague to use this repository, as he was able to implement protection. When I started testing I ran into a problem -- verify and verifystring display false all the time.
code:
result from console: