recaptcha

package module
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

captcha google v2

This plugin uses google recaptcha to replace the default graphical verification code

Notice

This plug-in needs to load Google resources. Before using it, please make sure that the network can fully load related resources.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Info embed.FS

Functions

This section is empty.

Types

type Captcha

type Captcha struct {
	Config *CaptchaConfig
}

func (*Captcha) ConfigFields

func (c *Captcha) ConfigFields() []plugin.ConfigField

func (*Captcha) ConfigReceiver

func (c *Captcha) ConfigReceiver(config []byte) error

func (*Captcha) Create

func (c *Captcha) Create() (captcha, code string)

func (*Captcha) GetConfig

func (c *Captcha) GetConfig() (config string)

func (*Captcha) Info

func (c *Captcha) Info() plugin.Info

func (*Captcha) Verify

func (c *Captcha) Verify(captcha, userInput string) (pass bool)

type CaptchaConfig

type CaptchaConfig struct {
	SiteKey            string `json:"site_key"`
	SecretKey          string `json:"secret_key"`
	SiteVerifyEndpoint string `json:"site_verify_endpoint"`
}

type GoogleCaptchaResponse

type GoogleCaptchaResponse struct {
	Success    bool     `json:"success"`
	ErrorCodes []string `json:"error-codes"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL