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