Skip to content

Commit

Permalink
Check error when generating tokens with the API client
Browse files Browse the repository at this point in the history
Fixes #13925
  • Loading branch information
zmb3 committed Jun 28, 2022
1 parent c206824 commit 7f6f2a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1859,7 +1859,10 @@ func (c *Client) UpsertToken(ctx context.Context, token types.ProvisionToken) er
// the Auth server and get a signed certificate and private key.
func (c *Client) GenerateToken(ctx context.Context, req *proto.GenerateTokenRequest) (string, error) {
resp, err := c.grpc.GenerateToken(ctx, req, c.callOpts...)
return resp.Token, trail.FromGRPC(err)
if err != nil {
return "", trail.FromGRPC(err)
}
return resp.Token, nil
}

// DeleteToken deletes a provision token by name.
Expand Down

0 comments on commit 7f6f2a2

Please sign in to comment.