logs-analyzer/signoz/pkg/query-service/common/user.go

17 lines
315 B
Go
Raw Permalink Normal View History

2024-09-02 22:47:30 +03:00
package common
import (
"context"
"go.signoz.io/signoz/pkg/query-service/constants"
"go.signoz.io/signoz/pkg/query-service/model"
)
func GetUserFromContext(ctx context.Context) *model.UserPayload {
user, ok := ctx.Value(constants.ContextUserKey).(*model.UserPayload)
if !ok {
return nil
}
return user
}