Skip to content

Commit

Permalink
Merge branch 'release/0.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
riton committed Jan 3, 2022
2 parents 4810295 + 3a8af38 commit 0b6bfec
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.pdf
ensap-payroll-cli
ensap
ensap-cli
/dist
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 2022-01-03 - Remi Ferrand - v0.2.1

* Modification liée au changement d'authentification sur le site ensap (voir #1)

## 2021-09-13 - Remi Ferrand - v0.2.0

* Ajout de la sous commande `version`
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ENSAP CLI

[![Go Report Card](https://goreportcard.com/badge/github.com/riton/ensap-cli)](https://goreportcard.com/report/github.com/riton/ensap-cli)

**Attention**: Cet outil est encore en développement. L'outil `ensap` n'étant accessible que depuis très peu de temps, les commandes présentées ci-dessous peuvent évoluer.

## Description
Expand Down
7 changes: 7 additions & 0 deletions api/v1/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,20 @@ func (c *ensapV1APIClient) Login() error {

endpoint := c.buildFullEndpoint(api.AuthentificationEndpoint, false)

log.Debugf("logging in using endpoint %s", endpoint)

req, err := http.NewRequestWithContext(c.ctx, http.MethodPost, endpoint, strings.NewReader(formData.Encode()))
if err != nil {
return errors.Wrap(err, "creating request object")
}
c.setRequestUserAgent(req)

req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req.Header.Set("Accept", "application/json")

// if c.cfg.Debug {
// debugDumpHTTPRequest("Login", req, true)
// }

resp, err := c.httpClient.Do(req)
if err != nil {
Expand Down

0 comments on commit 0b6bfec

Please sign in to comment.