Make the captcha shorter
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				requirements / merge-conditions (pull_request) Has been cancelled
				
			
		
			
				
	
				testing / backend-checks (pull_request) Has been cancelled
				
			
		
			
				
	
				testing / frontend-checks (pull_request) Has been cancelled
				
			
		
			
				
	
				issue-labels / backporting (pull_request_target) Has been cancelled
				
			
		
			
				
	
				milestone / set (pull_request_target) Has been cancelled
				
			
		
			
				
	
				testing / test-unit (pull_request) Has been cancelled
				
			
		
			
				
	
				testing / test-e2e (pull_request) Has been cancelled
				
			
		
			
				
	
				testing / test-remote-cacher (redis) (pull_request) Has been cancelled
				
			
		
			
				
	
				testing / test-remote-cacher (valkey) (pull_request) Has been cancelled
				
			
		
			
				
	
				testing / test-remote-cacher (garnet) (pull_request) Has been cancelled
				
			
		
			
				
	
				testing / test-remote-cacher (redict) (pull_request) Has been cancelled
				
			
		
			
				
	
				testing / test-mysql (pull_request) Has been cancelled
				
			
		
			
				
	
				testing / test-pgsql (pull_request) Has been cancelled
				
			
		
			
				
	
				testing / test-sqlite (pull_request) Has been cancelled
				
			
		
			
				
	
				testing / security-check (pull_request) Has been cancelled
				
			
		
		
	
	
		
	
		
			Some checks failed
		
		
	
	requirements / merge-conditions (pull_request) Has been cancelled
				
			testing / backend-checks (pull_request) Has been cancelled
				
			testing / frontend-checks (pull_request) Has been cancelled
				
			issue-labels / backporting (pull_request_target) Has been cancelled
				
			milestone / set (pull_request_target) Has been cancelled
				
			testing / test-unit (pull_request) Has been cancelled
				
			testing / test-e2e (pull_request) Has been cancelled
				
			testing / test-remote-cacher (redis) (pull_request) Has been cancelled
				
			testing / test-remote-cacher (valkey) (pull_request) Has been cancelled
				
			testing / test-remote-cacher (garnet) (pull_request) Has been cancelled
				
			testing / test-remote-cacher (redict) (pull_request) Has been cancelled
				
			testing / test-mysql (pull_request) Has been cancelled
				
			testing / test-pgsql (pull_request) Has been cancelled
				
			testing / test-sqlite (pull_request) Has been cancelled
				
			testing / security-check (pull_request) Has been cancelled
				
			This commit is contained in:
		
					parent
					
						
							
								3565c27520
							
						
					
				
			
			
				commit
				
					
						27c743296b
					
				
			
		
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -5,6 +5,7 @@ package context
 | 
			
		|||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"math/rand"
 | 
			
		||||
	"sync"
 | 
			
		||||
 | 
			
		||||
	"forgejo.org/modules/base"
 | 
			
		||||
| 
						 | 
				
			
			@ -55,7 +56,9 @@ func GetImageCaptcha() string {
 | 
			
		|||
	imageCaptchaOnce.Do(func() {
 | 
			
		||||
		captcha.SetCustomStore(&imageCaptchaStore{c: cache.GetCache()})
 | 
			
		||||
	})
 | 
			
		||||
	return captcha.New()
 | 
			
		||||
 | 
			
		||||
	length := 4 + rand.Intn(2)
 | 
			
		||||
	return captcha.NewLen(length)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SetCaptchaData sets common captcha data
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue