From 1fd8c9b2c3ea5b711002399cfe019afb652b3048 Mon Sep 17 00:00:00 2001 From: BetaPictoris Date: Sun, 6 Aug 2023 03:01:25 -0700 Subject: [PATCH] Fix else if (`gocritic`) --- server/ctrlsubsonic/middleware.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/ctrlsubsonic/middleware.go b/server/ctrlsubsonic/middleware.go index ff77e6c..a7e72d8 100644 --- a/server/ctrlsubsonic/middleware.go +++ b/server/ctrlsubsonic/middleware.go @@ -153,10 +153,8 @@ func (c *Controller) WithUser(next http.Handler) http.Handler { var credsOk bool if tokenAuth && newLDAPUser { credsOk = checkCredsToken(user.Password, token, salt) - } else { - if newLDAPUser { - credsOk = checkCredsBasic(user.Password, password) - } + } else if newLDAPUser { + credsOk = checkCredsBasic(user.Password, password) } if !credsOk { // Because internal authentication failed, we can now try to use LDAP, if