Skip to content

Commit

Permalink
Merge pull request #39 from superfly/discharge-nocallback-parallel
Browse files Browse the repository at this point in the history
fetch discharge tokens in parallel if no URL callback is provided
  • Loading branch information
wjordan authored Dec 17, 2024
2 parents 07f7fc8 + 2719b15 commit cc1420d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ func (c *Client) FetchDischargeTokens(ctx context.Context, tokenHeader string) (

for tpLoc, locTickets := range tickets {
for _, ticket := range locTickets {
// Do discharges sequentially if we've been given a cookie jar.
// Do discharges sequentially if we've been given a cookie jar and a URL callback.
// Allowing one discharge to finish before proceeding to the next
// increases our chances that a session will save us from user
// interaction.
if c.http.Jar != nil {
if c.http.Jar != nil && c.userURLCallback != nil {
if dis, err := c.fetchDischargeToken(ctx, tpLoc, ticket); err != nil {
combinedErr = errors.Join(combinedErr, err)
} else {
Expand Down

0 comments on commit cc1420d

Please sign in to comment.