Skip to content

Commit 9b11012

Browse files
author
刘顺钰
committed
feat(inmemory): verify method must check the empty id and answer.
1 parent 2180624 commit 9b11012

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

store_memory.go

+1-1
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)