Skip to content

Commit

Permalink
feat: switch to async backchannel logout
Browse files Browse the repository at this point in the history
  • Loading branch information
aarmam committed Mar 21, 2022
1 parent f320673 commit 8a65086
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions consent/strategy_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"net/url"
"strconv"
"strings"
"sync"
"time"

"github.com/ory/hydra/driver/config"
Expand Down Expand Up @@ -696,13 +695,9 @@ func (s *DefaultStrategy) executeBackChannelLogout(ctx context.Context, r *http.
tasks = append(tasks, task{url: c.BackChannelLogoutURI, clientID: c.OutfacingID, token: t})
}

var wg sync.WaitGroup
hc := httpx.NewResilientClient()
wg.Add(len(tasks))

var execute = func(t task) {
defer wg.Done()

res, err := hc.PostForm(t.url, url.Values{"logout_token": {t.token}})
if err != nil {
s.r.Logger().WithRequest(r).WithError(err).
Expand All @@ -727,8 +722,6 @@ func (s *DefaultStrategy) executeBackChannelLogout(ctx context.Context, r *http.
go execute(t)
}

wg.Wait()

return nil
}

Expand Down

0 comments on commit 8a65086

Please sign in to comment.