zitadel/internal/auth/repository/eventsourcing/eventstore/user_session.go
Fabi 207842be91
fix: fix some requests (#198)
* fix: alway do permission check

* fix: alway do permission check

* fix: add project query to applications search request

* fix: add email template to statik

* fix: org members
2020-06-10 10:47:50 +02:00

22 lines
614 B
Go

package eventstore
import (
"context"
"github.com/caos/zitadel/internal/api/auth"
"github.com/caos/zitadel/internal/auth/repository/eventsourcing/view"
usr_model "github.com/caos/zitadel/internal/user/model"
"github.com/caos/zitadel/internal/user/repository/view/model"
)
type UserSessionRepo struct {
View *view.View
}
func (repo *UserSessionRepo) GetMyUserSessions(ctx context.Context) ([]*usr_model.UserSessionView, error) {
userSessions, err := repo.View.UserSessionsByAgentID(auth.GetCtxData(ctx).AgentID)
if err != nil {
return nil, err
}
return model.UserSessionsToModel(userSessions), nil
}