Skip to content

Commit

Permalink
add two headers
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlaverse committed Oct 1, 2024
1 parent da8698d commit 4bf4965
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/bitwarden/webapi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ func (c *client) LoginWithPassword(ctx context.Context, username, password strin
return nil, fmt.Errorf("error preparing login with password request: %w", err)
}
httpReq.Header.Add("Auth-Email", base64.StdEncoding.EncodeToString([]byte(username)))
httpReq.Header.Add("Device-Type", c.deviceType)

tokenResp, err := doRequest[TokenResponse](ctx, c.httpClient, httpReq)
if err != nil {
Expand Down Expand Up @@ -399,6 +400,7 @@ func (c *client) prepareRequest(ctx context.Context, reqMethod, reqUrl string, r
if len(c.sessionAccessToken) > 0 {
httpReq.Header.Add("authorization", fmt.Sprintf("Bearer %s", c.sessionAccessToken))
}
httpReq.Header.Add("Accept", "application/json")

return httpReq, nil
}
Expand Down

0 comments on commit 4bf4965

Please sign in to comment.