Re-add debug message to get token function
This commit is contained in:
parent
8bbafd2ee7
commit
3d97b0174b
|
@ -2,6 +2,7 @@ package auth
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
@ -58,8 +59,14 @@ func GetToken(params *GetTokenParams) (*Token, error) {
|
|||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
body := make([]byte, res.ContentLength)
|
||||
if _, err := res.Body.Read(body); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var token Token
|
||||
if err := json.NewDecoder(res.Body).Decode(&token); err != nil {
|
||||
if err := json.Unmarshal(body, &token); err != nil {
|
||||
slog.Debug("failed to decode token", slog.Any("error", err), slog.String("body", string(body)))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue