Fix data race

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2018-06-01 18:14:32 -07:00
parent 26dafe464b
commit d3213df7f1

View File

@@ -129,8 +129,8 @@ func (s *Server) isClientAuthorized(c *client) bool {
opts := s.getOpts()
// Check custom auth first, then multiple users, then token, then single user/pass.
if s.opts.CustomClientAuthentication != nil {
return s.opts.CustomClientAuthentication.Check(c)
if opts.CustomClientAuthentication != nil {
return opts.CustomClientAuthentication.Check(c)
} else if s.users != nil {
user, ok := s.users[c.opts.Username]
if !ok {