MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / NeedCaptcha

Method NeedCaptcha

core/init/auth/ip_tracker.go:35–50  ·  view source on GitHub ↗
(ip string)

Source from the content-addressed store, hash-verified

33}
34
35func (t *IPTracker) NeedCaptcha(ip string) bool {
36 t.mu.Lock()
37 defer t.mu.Unlock()
38
39 record, exists := t.records[ip]
40 if !exists {
41 return false
42 }
43
44 if !t.prepareRecordUnsafe(ip, record) {
45 t.removeIPUnsafe(ip)
46 return false
47 }
48
49 return record.NeedCaptcha
50}
51
52func (t *IPTracker) IsLocked(ip string) bool {
53 t.mu.Lock()

Callers 2

LoginMethod · 0.80
GetLoginSettingMethod · 0.80

Calls 2

prepareRecordUnsafeMethod · 0.95
removeIPUnsafeMethod · 0.95

Tested by

no test coverage detected