Fixed nil password causing invalid dereferences

This commit is contained in:
BetaPictoris
2023-10-27 16:02:47 -07:00
parent 667cf731fd
commit a99d63ab12
2 changed files with 3 additions and 3 deletions

No files matched your search

+2 -2
View File
@@ -146,9 +146,9 @@ func (c *Controller) WithUser(next http.Handler) http.Handler {
}
}
var credsOk bool
if tokenAuth && !newLDAPUser {
if tokenAuth && !newLDAPUser && user != nil {
credsOk = checkCredsToken(user.Password, token, salt)
} else if !newLDAPUser {
} else if !newLDAPUser && user != nil {
credsOk = checkCredsBasic(user.Password, password)
}
if !credsOk {