Fix bugs in wizard and cscli (#577)

* fix id generation bug

* fix api client response

Co-authored-by: AlteredCoder <AlteredCoder>
This commit is contained in:
AlteredCoder 2021-01-15 18:14:50 +01:00 committed by GitHub
parent 8bd53a89c0
commit 81e7db71ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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
}

View file

@ -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 ?*/