Documentation
¶
Overview ¶
Package hcaptcha is a simple middleware that checks for an HCaptcha UUID and then validates it. It returns an error if the UUID is not valid (the request may have been sent by a robot).
Index ¶
Constants ¶
View Source
const DefaultSiteVerifyURL = "https://api.hcaptcha.com/siteverify"
DefaultSiteVerifyURL is the default URL for the HCaptcha API
Variables ¶
This section is empty.
Functions ¶
func DefaultResponseKeyFunc ¶
DefaultResponseKeyFunc is the default function to get the HCaptcha token from the request body
Types ¶
type Config ¶
type Config struct { // SecretKey is the secret key you get from HCaptcha when you create a new application SecretKey string // ResponseKeyFunc should return the generated pass UUID from the ctx, which will be validated ResponseKeyFunc func(fiber.Ctx) (string, error) // SiteVerifyURL is the endpoint URL where the program should verify the given token // default value is: "https://api.hcaptcha.com/siteverify" SiteVerifyURL string }
Config defines the config for HCaptcha middleware.
Click to show internal directories.
Click to hide internal directories.