Skip to content

Commit

Permalink
fix: log error reason on terminate session
Browse files Browse the repository at this point in the history
  • Loading branch information
livio-a committed Jun 21, 2021
1 parent 5d5c15c commit 57d3a68
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/api/oidc/auth_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"
"time"

"github.com/caos/logging"
"github.com/caos/oidc/pkg/oidc"
"github.com/caos/oidc/pkg/op"
"gopkg.in/square/go-jose.v2"
Expand Down Expand Up @@ -145,13 +146,17 @@ func (o *OPStorage) TerminateSession(ctx context.Context, userID, clientID strin
defer func() { span.EndWithError(err) }()
userAgentID, ok := middleware.UserAgentIDFromCtx(ctx)
if !ok {
logging.Log("OIDC-aGh4q").Error("no user agent id")
return errors.ThrowPreconditionFailed(nil, "OIDC-fso7F", "no user agent id")
}
userIDs, err := o.repo.UserSessionUserIDsByAgentID(ctx, userAgentID)
if err != nil {
logging.Log("OIDC-Ghgr3").WithError(err).Error("error retrieving user sessions")
return err
}
return o.command.HumansSignOut(ctx, userAgentID, userIDs)
err = o.command.HumansSignOut(ctx, userAgentID, userIDs)
logging.Log("OIDC-Dggt2").OnError(err).Error("error signing out")
return err
}

func (o *OPStorage) GetSigningKey(ctx context.Context, keyCh chan<- jose.SigningKey) {
Expand Down

0 comments on commit 57d3a68

Please sign in to comment.