Skip to content

Commit

Permalink
feat: add debug log for accessible-resources on oauth login
Browse files Browse the repository at this point in the history
  • Loading branch information
HandOfGod94 committed Oct 15, 2023
1 parent 9a5abf3 commit 31d5c53
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/jira_changelog/jira/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"crypto/tls"
"fmt"
"io"
"log"
"net/http"
"time"
Expand Down Expand Up @@ -84,6 +85,14 @@ func (a *Authenticator) callbackHandler(w http.ResponseWriter, r *http.Request)
panic(err)
}

accessibleResources, err := io.ReadAll(resp.Body)
if err != nil {
slog.Error("failed to read accessibleResources", "error", err)
panic(err)
}
slog.Debug("Retrieved accessible resources successfully", "resources", string(accessibleResources))


msg := "<h1>Authentication successful!</h1>"
msg = msg + "<p>You are authenticated and can now return to the CLI.</p>"
fmt.Fprintln(w, msg)
Expand Down

0 comments on commit 31d5c53

Please sign in to comment.