We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ec5cb01 + 1621c27 commit 9362c39Copy full SHA for 9362c39
logic/security.go
@@ -187,7 +187,7 @@ func authenticateDNSToken(tokenString string) bool {
187
if len(tokens) < 2 {
188
return false
189
}
190
- return tokens[1] == servercfg.GetDNSKey()
+ return len(servercfg.GetDNSKey()) > 0 && tokens[1] == servercfg.GetDNSKey()
191
192
193
func ContinueIfUserMatch(next http.Handler) http.HandlerFunc {
servercfg/serverconf.go
@@ -277,7 +277,7 @@ func GetMasterKey() string {
277
278
// GetDNSKey - gets the configured dns key of server
279
func GetDNSKey() string {
280
- key := "secretkey"
+ key := ""
281
if os.Getenv("DNS_KEY") != "" {
282
key = os.Getenv("DNS_KEY")
283
} else if config.Config.Server.DNSKey != "" {
0 commit comments