Skip to content

Commit

Permalink
feat(inmemory): verify method must check the empty id and answer.
Browse files Browse the repository at this point in the history
  • Loading branch information
刘顺钰 committed Sep 7, 2022
1 parent 2180624 commit 9b11012
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion store_memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (s *memoryStore) Set(id string, value string) error {

func (s *memoryStore) Verify(id, answer string, clear bool) bool {
v := s.Get(id, clear)
return v == answer
return v != "" && v == answer
}

func (s *memoryStore) Get(id string, clear bool) (value string) {
Expand Down

0 comments on commit 9b11012

Please sign in to comment.