aboutsummaryrefslogtreecommitdiff
path: root/cmd/create-account/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/create-account/main.go')
-rw-r--r--cmd/create-account/main.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/create-account/main.go b/cmd/create-account/main.go
index 52301415..c8e239f2 100644
--- a/cmd/create-account/main.go
+++ b/cmd/create-account/main.go
@@ -179,7 +179,10 @@ func sharedSecretRegister(sharedSecret, serverURL, localpart, password string, a
body, _ = io.ReadAll(regResp.Body)
return "", fmt.Errorf(gjson.GetBytes(body, "error").Str)
}
- r, _ := io.ReadAll(regResp.Body)
+ r, err := io.ReadAll(regResp.Body)
+ if err != nil {
+ return "", fmt.Errorf("failed to read response body (HTTP %d): %w", regResp.StatusCode, err)
+ }
return gjson.GetBytes(r, "access_token").Str, nil
}