diff --git a/persistence.go b/persistence.go index 9c9e4df..e8827f1 100644 --- a/persistence.go +++ b/persistence.go @@ -362,6 +362,14 @@ func updateUser(username, password string) { conn := globalPool.Get() defer conn.Close() logit("updateUser: " + username) + + // we exit if user does not exit + exists, _ := redis.Bool(conn.Do("EXISTS", userPrefix+username)) + if !exists { + logit("updateUser: User does not exist: " + username) + return + } + pwd := []byte(password) hashedPassword, err := bcrypt.GenerateFromPassword(pwd, bcrypt.DefaultCost) if err != nil {