mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-02 04:12:16 +00:00
fix(sessions): add an expiration date filter to list sessions api (#10384)
# Which Problems Are Solved The deletion of expired sessions does not go through even though a success response is returned to the user. These expired and supposedly deleted (to the user) sessions are then returned when the `ListSessions` API is called. This PR fixes this issue by: 1. Allowing deletion of expired sessions 2. Providing an `expiration_date` filter in `ListSession` API to filter sessions by expiration date # How the Problems Are Solved 1. Remove expired session check during deletion 2. Add an `expiration_date` filter to the `ListSession` API # Additional Changes N/A # Additional Context - Closes #10045 --------- Co-authored-by: Marco A. <[email protected]>
This commit is contained in:
co-authored by
Marco A.
parent
7e184727b0
commit
a96f4708cb
@@ -346,7 +346,9 @@ func (c *Commands) terminateSession(ctx context.Context, sessionID, sessionToken
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if sessionWriteModel.CheckIsActive() != nil {
|
||||
|
||||
// exclude expiration check as expired tokens can be deleted
|
||||
if sessionWriteModel.State == domain.SessionStateUnspecified || sessionWriteModel.State == domain.SessionStateTerminated {
|
||||
return writeModelToObjectDetails(&sessionWriteModel.WriteModel), nil
|
||||
}
|
||||
terminate := session.NewTerminateEvent(ctx, &session.NewAggregate(sessionWriteModel.AggregateID, sessionWriteModel.ResourceOwner).Aggregate)
|
||||
|
||||
Reference in New Issue
Block a user