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:
parent
8bd53a89c0
commit
81e7db71ed
|
@ -72,8 +72,8 @@ func generateID() (string, error) {
|
||||||
}
|
}
|
||||||
id = string(bID)
|
id = string(bID)
|
||||||
}
|
}
|
||||||
id = fmt.Sprintf("%s%s", id, generatePassword(16))
|
|
||||||
id = strings.ReplaceAll(id, "-", "")[:32]
|
id = strings.ReplaceAll(id, "-", "")[:32]
|
||||||
|
id = fmt.Sprintf("%s%s", id, generatePassword(16))
|
||||||
return id, nil
|
return id, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@ func (t *JWTTransport) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||||
resp, err := t.transport().RoundTrip(req)
|
resp, err := t.transport().RoundTrip(req)
|
||||||
if log.GetLevel() >= log.TraceLevel {
|
if log.GetLevel() >= log.TraceLevel {
|
||||||
dump, _ := httputil.DumpResponse(resp, true)
|
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 {
|
if err != nil || resp.StatusCode == 401 {
|
||||||
/*we had an error (network error for example, or 401 because token is refused), reset the token ?*/
|
/*we had an error (network error for example, or 401 because token is refused), reset the token ?*/
|
||||||
|
|
Loading…
Reference in a new issue