Fix active session must not be return if expired

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-12-18 18:24:06 +01:00
parent 7a26473e8f
commit 970a734964
2 changed files with 13 additions and 2 deletions

View File

@@ -300,6 +300,14 @@ func (s SessionService) GetActiveSessionForMembership(ctx context.Context, rootS
return fmt.Errorf("cannot load child session: %w", err)
}
if childSession.ExpireReason != nil {
return NewSessionExpiredError(childSession.ID)
}
if time.Now().After(childSession.ExpiredAt) {
return NewSessionExpiredError(childSession.ID)
}
return nil
},
)