Auth: Fix render user OAuth passthrough (#111636)
* devenv: fix volumes section when sources don't contain one * wip * Working correctly with improvedExternalSessionHandling on * Remove not needed lines * Working with the old flow, tests * Handle compatibility with the feature toggle, tests wip * Tests * Cleanup * Address feedback * Align tests * Add comment * Fix issue with session removal after the invalidation of tokens * Remove commented out code * clean up
This commit is contained in:
@@ -56,6 +56,8 @@ func (s *store) Get(ctx context.Context, ID int64) (*auth.ExternalSession, error
|
||||
return externalSession, nil
|
||||
}
|
||||
|
||||
// List returns a list of external sessions that match the given query.
|
||||
// If the result set contains more than one entry, the entries are sorted by ID in descending order.
|
||||
func (s *store) List(ctx context.Context, query *auth.ListExternalSessionQuery) ([]*auth.ExternalSession, error) {
|
||||
ctx, span := s.tracer.Start(ctx, "externalsession.List")
|
||||
defer span.End()
|
||||
@@ -65,6 +67,10 @@ func (s *store) List(ctx context.Context, query *auth.ListExternalSessionQuery)
|
||||
externalSession.ID = query.ID
|
||||
}
|
||||
|
||||
if query.UserID != 0 {
|
||||
externalSession.UserID = query.UserID
|
||||
}
|
||||
|
||||
hash := sha256.New()
|
||||
|
||||
if query.SessionID != "" {
|
||||
@@ -80,7 +86,7 @@ func (s *store) List(ctx context.Context, query *auth.ListExternalSessionQuery)
|
||||
|
||||
queryResult := make([]*auth.ExternalSession, 0)
|
||||
err := s.sqlStore.WithDbSession(ctx, func(sess *db.Session) error {
|
||||
return sess.Find(&queryResult, externalSession)
|
||||
return sess.Desc("id").Find(&queryResult, externalSession)
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user