Reset authSet state

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2022-01-21 10:40:35 -08:00
parent ae43b24be4
commit ecd0d8eaff
2 changed files with 6 additions and 2 deletions

View File

@@ -282,7 +282,7 @@ func TestNoAuthUserNoConnectProto(t *testing.T) {
accounts {
A { users [{user: "foo", password: "pwd"}] }
}
authorization { timeout: 1s }
authorization { timeout: 1 }
no_auth_user: "foo"
`))
defer os.Remove(conf)

View File

@@ -171,7 +171,11 @@ func (c *client) parse(buf []byte) error {
s.mu.Unlock()
if exists {
c.RegisterUser(user)
ok = true
c.mu.Lock()
c.clearAuthTimer()
c.flags.set(connectReceived)
c.mu.Unlock()
authSet, ok = false, true
}
}
if !ok {