got logging in to work
This commit is contained in:
@@ -15,6 +15,7 @@ func check_password(attempt string) (result bool) {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
// this feels ultra hokey ... I guess I could take it from 2N to N by |= ...
|
||||
hashes := []string{}
|
||||
cmd := "SELECT hash FROM passes;"
|
||||
db.Execute(cmd, func(s *sqlite3.Statement, values ...interface{}) {
|
||||
@@ -22,7 +23,7 @@ func check_password(attempt string) (result bool) {
|
||||
hashes = append(hashes, cur_hash)
|
||||
})
|
||||
for _, hash := range hashes {
|
||||
err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(*check_pw))
|
||||
err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(attempt))
|
||||
if err == nil {
|
||||
result = true
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user