ref(auth/csvauth): don't hold mutex longer than necessary

This commit is contained in:
AJ ONeal 2026-03-03 03:05:05 -07:00
parent 020b00c353
commit c32acd5a74
No known key found for this signature in database

View File

@ -363,9 +363,10 @@ func (a *Auth) Authenticate(name, secret string) (auth.BasicPrinciple, error) {
}
a.mux.Lock()
defer a.mux.Unlock()
nameID := a.nameCacheID(name)
c, ok := a.hashedCredentials[nameID]
a.mux.Unlock()
if ok {
if err := c.Verify(name, secret); err != nil {
return nil, err