diff --git a/_examples/miscellaneous/recaptcha/main.go b/_examples/miscellaneous/recaptcha/main.go index f908b78f..0648bede 100644 --- a/_examples/miscellaneous/recaptcha/main.go +++ b/_examples/miscellaneous/recaptcha/main.go @@ -26,7 +26,7 @@ func main() { return } - result := recaptcha.SiteFerify(ctx, recaptchaSecret) + result := recaptcha.SiteVerify(ctx, recaptchaSecret) if !result.Success { /* redirect here if u want or do nothing */ ctx.HTML(" failed please try again ") diff --git a/middleware/recaptcha/recaptcha.go b/middleware/recaptcha/recaptcha.go index ec416883..cd54a66b 100644 --- a/middleware/recaptcha/recaptcha.go +++ b/middleware/recaptcha/recaptcha.go @@ -39,18 +39,18 @@ var Client = netutil.Client(time.Duration(20 * time.Second)) // Use `SiteVerify` to verify a request inside another handler if needed. func New(secret string) context.Handler { return func(ctx context.Context) { - if SiteFerify(ctx, secret).Success { + if SiteVerify(ctx, secret).Success { ctx.Next() } } } -// SiteFerify accepts context and the secret key(https://www.google.com/recaptcha) +// SiteVerify accepts context and the secret key(https://www.google.com/recaptcha) // and returns the google's recaptcha response, if `response.Success` is true // then validation passed. // // Use `New` for middleware use instead. -func SiteFerify(ctx context.Context, secret string) (response Response) { +func SiteVerify(ctx context.Context, secret string) (response Response) { generatedResponseID := ctx.FormValue("g-recaptcha-response") if generatedResponseID == "" { response.ErrorCodes = append(response.ErrorCodes, @@ -111,7 +111,7 @@ var recaptchaForm = `