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