Fix else if (gocritic)

This commit is contained in:
BetaPictoris
2023-08-06 03:02:13 -07:00
parent 9c56bf61ab
commit 1fd8c9b2c3
+2 -4
View File
@@ -153,10 +153,8 @@ func (c *Controller) WithUser(next http.Handler) http.Handler {
var credsOk bool var credsOk bool
if tokenAuth && newLDAPUser { if tokenAuth && newLDAPUser {
credsOk = checkCredsToken(user.Password, token, salt) credsOk = checkCredsToken(user.Password, token, salt)
} else { } else if newLDAPUser {
if newLDAPUser { credsOk = checkCredsBasic(user.Password, password)
credsOk = checkCredsBasic(user.Password, password)
}
} }
if !credsOk { if !credsOk {
// Because internal authentication failed, we can now try to use LDAP, if // Because internal authentication failed, we can now try to use LDAP, if