recaptcha

GitHub Workflow Status Codecov GoDoc Sourcegraph

Package recaptcha is a middleware that provides reCAPTCHA integration for Flamego.

Installation

The minimum requirement of Go is 1.16.

  1. go get github.com/flamego/recaptcha

Getting started

  1. package main
  2. import (
  3. "github.com/flamego/flamego"
  4. "github.com/flamego/recaptcha"
  5. )
  6. func main() {
  7. f := flamego.Classic()
  8. f.Use(recaptcha.V2(recaptcha.Options{
  9. Secret: "<YOUR_SECRET_HERE>",
  10. VerifyURL: recaptcha.VerifyURLGlobal,
  11. }))
  12. f.Get("/verify", func(c flamego.Context, r recaptcha.RecaptchaV2) {
  13. response, err := r.Verify(input)
  14. if response.Success{
  15. //...
  16. }
  17. })
  18. f.Run()
  19. }

Getting help

License

This project is under the MIT License. See the LICENSE file for the full license text.