mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 11:28:59 +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) {
|
func restGetConfig(w http.ResponseWriter) {
|
||||||
encCfg := cfg
|
encCfg := cfg
|
||||||
encCfg.GUI.Password = unchangedPassword
|
if encCfg.GUI.Password != "" {
|
||||||
|
encCfg.GUI.Password = unchangedPassword
|
||||||
|
}
|
||||||
json.NewEncoder(w).Encode(encCfg)
|
json.NewEncoder(w).Encode(encCfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +121,9 @@ func restPostConfig(req *http.Request) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
warnln(err)
|
warnln(err)
|
||||||
} else {
|
} 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)
|
hash, err := bcrypt.GenerateFromPassword([]byte(cfg.GUI.Password), 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
warnln(err)
|
warnln(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user