mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
Let absence of password be absence
This commit is contained in:
parent
c64549471a
commit
9349eb77cd
@ -109,7 +109,9 @@ func restGetConnections(m *Model, w http.ResponseWriter) {
|
||||
|
||||
func restGetConfig(w http.ResponseWriter) {
|
||||
encCfg := cfg
|
||||
encCfg.GUI.Password = unchangedPassword
|
||||
if encCfg.GUI.Password != "" {
|
||||
encCfg.GUI.Password = unchangedPassword
|
||||
}
|
||||
json.NewEncoder(w).Encode(encCfg)
|
||||
}
|
||||
|
||||
@ -119,7 +121,9 @@ func restPostConfig(req *http.Request) {
|
||||
if err != nil {
|
||||
warnln(err)
|
||||
} else {
|
||||
if cfg.GUI.Password != unchangedPassword {
|
||||
if cfg.GUI.Password == "" {
|
||||
// Leave it empty
|
||||
} else if cfg.GUI.Password != unchangedPassword {
|
||||
hash, err := bcrypt.GenerateFromPassword([]byte(cfg.GUI.Password), 0)
|
||||
if err != nil {
|
||||
warnln(err)
|
||||
|
Loading…
Reference in New Issue
Block a user