fix: race condition when updating user auth

This commit is contained in:
James Houlahan
2020-04-22 15:07:35 +02:00
committed by Michal Horejsek
parent 51846efed5
commit 8f15041d8f
4 changed files with 11 additions and 33 deletions

View File

@ -217,12 +217,7 @@ func (c *client) sendAuth(auth *Auth) {
c.accessToken = auth.accessToken
}
go func(auth ClientAuth) {
c.cm.clientAuths <- auth
}(ClientAuth{
UserID: c.userID,
Auth: auth,
})
c.cm.HandleAuth(ClientAuth{UserID: c.userID, Auth: auth})
}
// AuthInfo gets authentication info for a user.