mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Add option to enable CAPTCHA validation for login (#21638)
Enable this to require captcha validation for user login. You also must enable `ENABLE_CAPTCHA`. Summary: - Consolidate CAPTCHA template - add CAPTCHA handle and context - add `REQUIRE_CAPTCHA_FOR_LOGIN` config and docs - Consolidate CAPTCHA set-up and verification code Partially resolved #6049 Signed-off-by: Xinyu Zhou <i@sourcehut.net> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		@@ -27,11 +27,8 @@ func (f *SignInOpenIDForm) Validate(req *http.Request, errs binding.Errors) bind
 | 
			
		||||
 | 
			
		||||
// SignUpOpenIDForm form for signin up with OpenID
 | 
			
		||||
type SignUpOpenIDForm struct {
 | 
			
		||||
	UserName           string `binding:"Required;Username;MaxSize(40)"`
 | 
			
		||||
	Email              string `binding:"Required;Email;MaxSize(254)"`
 | 
			
		||||
	GRecaptchaResponse string `form:"g-recaptcha-response"`
 | 
			
		||||
	HcaptchaResponse   string `form:"h-captcha-response"`
 | 
			
		||||
	McaptchaResponse   string `form:"m-captcha-response"`
 | 
			
		||||
	UserName string `binding:"Required;Username;MaxSize(40)"`
 | 
			
		||||
	Email    string `binding:"Required;Email;MaxSize(254)"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Validate validates the fields
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user