![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
github.com/tango-contrib/captcha
Middleware captcha a middleware that provides captcha service for Tango.
go get github.com/tango-contrib/captcha
// main.go
import (
"github.com/lunny/tango"
"github.com/tango-contrib/cache"
"github.com/tango-contrib/captcha"
)
type CaptchaAction struct {
captcha.Captcha
renders.Renderer
}
func (c *CaptchaAction) Get() {
c.Render("captcha.html", renders.T{
"captcha": c.CreateHtml(),
})
}
func (c *CaptchaAction) Post() string {
if c.Verify() {
return "true"
}
return "false"
}
func main() {
t := tango.Classic()
t.Use(captcha.New())
t.Any("/", new(CaptchaAction))
t.Run()
}
<!-- templates/captcha.tmpl -->
{{.captcha}}
captcha.Captchaer
comes with a variety of configuration options:
// ...
t.Use(captcha.New(captcha.Options{
URLPrefix: "/captcha/", // URL prefix of getting captcha pictures.
FieldIdName: "captcha_id", // Hidden input element ID.
FieldCaptchaName: "captcha", // User input value element name in request form.
ChallengeNums: 6, // Challenge number.
Width: 240, // Captcha image width.
Height: 80, // Captcha image height.
Expiration: 600, // Captcha expiration time in seconds.
CachePrefix: "captcha_", // Cache key prefix captcha characters.
}, cache))
// ...
This project is under Apache v2 License. See the LICENSE file for the full license text.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.