Skip to content

Commit

Permalink
Merge pull request #105 from laushunyu/master
Browse files Browse the repository at this point in the history
feat(inmemory): verify method must check the empty id and answer.
  • Loading branch information
mojocn committed Mar 30, 2023
2 parents 2180624 + 9b11012 commit 657c2c1
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 657c2c1

Please sign in to comment.