Skip to content

Commit

Permalink
add more log
Browse files Browse the repository at this point in the history
  • Loading branch information
jonachang committed Nov 16, 2023
1 parent 86e532d commit 4fa870f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/poc/miseAuthentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"log"
"net/http"
)
Expand Down Expand Up @@ -42,11 +43,12 @@ func authenticateWithMISE(ctx context.Context, token string) error {
defer resp.Body.Close()
log.Default().Println("Response status: ", resp.Status)
log.Default().Println("Response body: ", resp.Body)
body, _ := ioutil.ReadAll(resp.Body)
switch resp.StatusCode {
case http.StatusOK:
return nil
default:
return fmt.Errorf("Unauthorized")
return fmt.Errorf(string(body))
}
}

Expand Down

0 comments on commit 4fa870f

Please sign in to comment.