diff --git a/cmd/crowdsec-cli/machines.go b/cmd/crowdsec-cli/machines.go index 81a9754ad..ac79f0de3 100644 --- a/cmd/crowdsec-cli/machines.go +++ b/cmd/crowdsec-cli/machines.go @@ -72,8 +72,8 @@ func generateID() (string, error) { } id = string(bID) } - id = fmt.Sprintf("%s%s", id, generatePassword(16)) id = strings.ReplaceAll(id, "-", "")[:32] + id = fmt.Sprintf("%s%s", id, generatePassword(16)) return id, nil } diff --git a/pkg/apiclient/auth.go b/pkg/apiclient/auth.go index 8c43ea39b..47acc15c2 100644 --- a/pkg/apiclient/auth.go +++ b/pkg/apiclient/auth.go @@ -189,7 +189,7 @@ func (t *JWTTransport) RoundTrip(req *http.Request) (*http.Response, error) { resp, err := t.transport().RoundTrip(req) if log.GetLevel() >= log.TraceLevel { dump, _ := httputil.DumpResponse(resp, true) - log.Tracef("resp-jwt: %s (err:%s)", string(dump), err) + log.Tracef("resp-jwt: %s (err:%v)", string(dump), err) } if err != nil || resp.StatusCode == 401 { /*we had an error (network error for example, or 401 because token is refused), reset the token ?*/