From 19f128556a83be83d7f7ae7d6f6cac769ce9f28f Mon Sep 17 00:00:00 2001 From: Jared Rodriguez Date: Thu, 8 Apr 2021 20:45:00 -0500 Subject: [PATCH] Update internal/authentication/auth.go Co-authored-by: Joe Julian --- internal/authentication/auth.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/authentication/auth.go b/internal/authentication/auth.go index 2b6e0b7..f024dd6 100644 --- a/internal/authentication/auth.go +++ b/internal/authentication/auth.go @@ -229,11 +229,12 @@ func (a *Authenticator) matchCookieDomains(domain string) (bool, string) { // Remove port p := strings.Split(domain, ":") - if a.config != nil { - for _, d := range a.config.CookieDomains { - if d.Match(p[0]) { - return true, d.Domain - } + if a.config == nil { + return false, p[0] + } + for _, d := range a.config.CookieDomains { + if d.Match(p[0]) { + return true, d.Domain } } return false, p[0]