Skip to content

Commit

Permalink
new: use POST for authentify (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
primalmotion authored Sep 7, 2019
1 parent 01a540e commit 170c8e2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,13 @@ func (a *Client) Authentify(ctx context.Context, token string) ([]string, error)
defer span.Finish()

builder := func() (*http.Request, error) {
return http.NewRequest(http.MethodGet, a.url+"/authn?token="+token, nil)
authn := gaia.NewAuthn()
authn.Token = token
data, err := json.Marshal(authn)
if err != nil {
return nil, err
}
return http.NewRequest(http.MethodPost, a.url+"/authn", bytes.NewBuffer(data))
}

resp, err := a.sendRetry(subctx, builder, token)
Expand Down

0 comments on commit 170c8e2

Please sign in to comment.