From 5c3f91bb554fd1da443d7228a033c951dc1a53f2 Mon Sep 17 00:00:00 2001 From: Xhofe Date: Tue, 15 Feb 2022 14:42:24 +0800 Subject: [PATCH] :sparkles: support empty password --- model/setting.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/model/setting.go b/model/setting.go index b70fbd72..5571bc94 100644 --- a/model/setting.go +++ b/model/setting.go @@ -114,7 +114,11 @@ func LoadSettings() { // token adminPassword, err := GetSettingByKey("password") if err == nil { - conf.Token = utils.GetMD5Encode(fmt.Sprintf("https://github.com/Xhofe/alist-%s", adminPassword.Value)) + if adminPassword.Value != "" { + conf.Token = utils.GetMD5Encode(fmt.Sprintf("https://github.com/Xhofe/alist-%s", adminPassword.Value)) + } else { + conf.Token = "" + } } // load settings for _, key := range conf.LoadSettings {