We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0513ab0 commit 3df8a86Copy full SHA for 3df8a86
1 file changed
internal/services/otp/service.go
@@ -38,9 +38,13 @@ func (s *Service) Email(email string) int {
38
39
func (s *Service) Check(identifier string, password string) bool {
40
if p, found := s.passwords[identifier]; found {
41
- defer delete(s.passwords, identifier)
42
if p.ExpireAt.Before(time.Now().Add(min3)) {
43
- return p.Value == password
+ if p.Value == password {
+ delete(s.passwords, identifier)
44
+ return true
45
+ }
46
+ } else {
47
48
}
49
50
return false
0 commit comments