MCPcopy Create free account
hub / github.com/QuantumNous/new-api / VerifyCodeWithKey

Function VerifyCodeWithKey

common/verification.go:47–56  ·  view source on GitHub ↗
(key string, code string, purpose string)

Source from the content-addressed store, hash-verified

45}
46
47func VerifyCodeWithKey(key string, code string, purpose string) bool {
48 verificationMutex.Lock()
49 defer verificationMutex.Unlock()
50 value, okay := verificationMap[purpose+key]
51 now := time.Now()
52 if !okay || int(now.Sub(value.time).Seconds()) >= VerificationValidMinutes*60 {
53 return false
54 }
55 return code == value.code
56}
57
58func DeleteKey(key string, purpose string) {
59 verificationMutex.Lock()

Callers 3

ResetPasswordFunction · 0.92
RegisterFunction · 0.92
EmailBindFunction · 0.92

Calls 1

UnlockMethod · 0.80

Tested by

no test coverage detected