Przeglądaj źródła

fix host password update

Anish Mukherjee 2 lat temu
rodzic
commit
fe9bc6f92d
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      logic/hosts.go

+ 3 - 0
logic/hosts.go

@@ -160,6 +160,9 @@ func UpdateHostFromClient(newHost, currHost *models.Host) (sendPeerUpdate bool)
 		currHost.EndpointIP = newHost.EndpointIP
 		sendPeerUpdate = true
 	}
+	if newHostPass, err := bcrypt.GenerateFromPassword([]byte(newHost.HostPass), 5); err == nil && string(newHostPass) != currHost.HostPass {
+		currHost.HostPass = string(newHostPass)
+	}
 	currHost.DaemonInstalled = newHost.DaemonInstalled
 	currHost.Debug = newHost.Debug
 	currHost.Verbosity = newHost.Verbosity