Skip to content

Commit 657c2c1

Browse files
authored
Merge pull request #105 from laushunyu/master
feat(inmemory): verify method must check the empty id and answer.
2 parents 2180624 + 9b11012 commit 657c2c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

store_memory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (s *memoryStore) Set(id string, value string) error {
6767

6868
func (s *memoryStore) Verify(id, answer string, clear bool) bool {
6969
v := s.Get(id, clear)
70-
return v == answer
70+
return v != "" && v == answer
7171
}
7272

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

0 commit comments

Comments
 (0)