VerifyCaptcha generate captcha
(ctx context.Context, key, captcha string)
| 150 | |
| 151 | // VerifyCaptcha generate captcha |
| 152 | func (cs *CaptchaService) VerifyCaptcha(ctx context.Context, key, captcha string) (isCorrect bool, err error) { |
| 153 | realCaptcha, _ := cs.captchaRepo.GetCaptcha(ctx, key) |
| 154 | |
| 155 | _ = plugin.CallCaptcha(func(fn plugin.Captcha) error { |
| 156 | isCorrect = fn.Verify(realCaptcha, captcha) |
| 157 | return nil |
| 158 | }) |
| 159 | |
| 160 | _ = cs.captchaRepo.DelCaptcha(ctx, key) |
| 161 | return isCorrect, nil |
| 162 | } |
no test coverage detected