mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-12 21:53:40 +00:00
fix: log error reason on terminate session (#1973)
This commit is contained in:
parent
cde29db571
commit
10cae58505
@ -6,6 +6,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/caos/logging"
|
||||||
"github.com/caos/oidc/pkg/oidc"
|
"github.com/caos/oidc/pkg/oidc"
|
||||||
"github.com/caos/oidc/pkg/op"
|
"github.com/caos/oidc/pkg/op"
|
||||||
"gopkg.in/square/go-jose.v2"
|
"gopkg.in/square/go-jose.v2"
|
||||||
@ -145,13 +146,17 @@ func (o *OPStorage) TerminateSession(ctx context.Context, userID, clientID strin
|
|||||||
defer func() { span.EndWithError(err) }()
|
defer func() { span.EndWithError(err) }()
|
||||||
userAgentID, ok := middleware.UserAgentIDFromCtx(ctx)
|
userAgentID, ok := middleware.UserAgentIDFromCtx(ctx)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
logging.Log("OIDC-aGh4q").Error("no user agent id")
|
||||||
return errors.ThrowPreconditionFailed(nil, "OIDC-fso7F", "no user agent id")
|
return errors.ThrowPreconditionFailed(nil, "OIDC-fso7F", "no user agent id")
|
||||||
}
|
}
|
||||||
userIDs, err := o.repo.UserSessionUserIDsByAgentID(ctx, userAgentID)
|
userIDs, err := o.repo.UserSessionUserIDsByAgentID(ctx, userAgentID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
logging.Log("OIDC-Ghgr3").WithError(err).Error("error retrieving user sessions")
|
||||||
return err
|
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) {
|
func (o *OPStorage) GetSigningKey(ctx context.Context, keyCh chan<- jose.SigningKey) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user