From 6ef80e8335080d985cbcb25c310ed1a0e8b233ec Mon Sep 17 00:00:00 2001 From: "fox.cpp" Date: Sun, 12 Mar 2023 15:15:30 +0300 Subject: [PATCH] Unbreak tests --- internal/auth/sasl.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/auth/sasl.go b/internal/auth/sasl.go index 8c67073..02783a2 100644 --- a/internal/auth/sasl.go +++ b/internal/auth/sasl.go @@ -66,9 +66,12 @@ func (s *SASLAuth) SASLMechanisms() []string { } func (s *SASLAuth) usernameForAuth(ctx context.Context, saslUsername string) (string, error) { - saslUsername, err := s.AuthNormalize(saslUsername) - if err != nil { - return "", err + if s.AuthNormalize != nil { + var err error + saslUsername, err = s.AuthNormalize(saslUsername) + if err != nil { + return "", err + } } if s.AuthMap == nil {