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

Method IsLocked

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

Source from the content-addressed store, hash-verified

50}
51
52func (t *IPTracker) IsLocked(ip string) bool {
53 t.mu.Lock()
54 defer t.mu.Unlock()
55
56 record, exists := t.records[ip]
57 if !exists {
58 return false
59 }
60
61 if !t.prepareRecordUnsafe(ip, record) {
62 t.removeIPUnsafe(ip)
63 return false
64 }
65
66 return time.Now().Before(record.LockedUntil)
67}
68
69func (t *IPTracker) SetNeedCaptcha(ip string) {
70 t.mu.Lock()

Callers 2

LoginMethod · 0.80
MFALoginMethod · 0.80

Calls 2

prepareRecordUnsafeMethod · 0.95
removeIPUnsafeMethod · 0.95

Tested by

no test coverage detected