Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CAPTCHADisabled = false
CAPTCHADisabled disables captcha requirements if true
var DatabaseURL string
var HostName string
var Mailer *mailerHelper
var Repo *repo
var VerificationURL = "https://www.google.com/recaptcha/api/siteverify"
defaultVerificationURL is The default URL that's used to verify the user's response to the challenge. @see https://developers.google.com/recaptcha/docs/verify#api-request
Functions ¶
Types ¶
type Guest ¶
func (Guest) GetGuestURL ¶
type Response ¶
type Response struct { Success bool `json:"success"` // Timestamp of the challenge load (ISO format yyyy-MM-dd'T'HH:mm:ssZZ) Challenge string `json:"challenge_ts"` // The hostname of the site where the reCAPTCHA was solved Hostname string `json:"hostname"` // Optional list of error codes returned by the service ErrorCodes []string `json:"error-codes"` }
Response is the JSON structure that is returned by the verification API after a challenge response is verified. @see https://developers.google.com/recaptcha/docs/verify#api-response
func CAPTCHAVerify ¶
Verify the users's response to the reCAPTCHA challenge with the API server.
The parameter response is obtained after the user successfully solves the challenge presented by the JS widget. The remoteip parameter is optional; just send it empty if you don't want to use it.
CAPTCHAVerify function will return a boolean that will have the final result returned by the API as well as an optional list of errors. They might be useful for logging purposed but you don't have to show them to the user.