diff --git a/logic/security.go b/logic/security.go index 1b57dc8b8..a6b13dbb7 100644 --- a/logic/security.go +++ b/logic/security.go @@ -187,7 +187,7 @@ func authenticateDNSToken(tokenString string) bool { if len(tokens) < 2 { return false } - return tokens[1] == servercfg.GetDNSKey() + return len(servercfg.GetDNSKey()) > 0 && tokens[1] == servercfg.GetDNSKey() } func ContinueIfUserMatch(next http.Handler) http.HandlerFunc { diff --git a/servercfg/serverconf.go b/servercfg/serverconf.go index c59253d91..1830cb661 100644 --- a/servercfg/serverconf.go +++ b/servercfg/serverconf.go @@ -277,7 +277,7 @@ func GetMasterKey() string { // GetDNSKey - gets the configured dns key of server func GetDNSKey() string { - key := "secretkey" + key := "" if os.Getenv("DNS_KEY") != "" { key = os.Getenv("DNS_KEY") } else if config.Config.Server.DNSKey != "" {