logs-analyzer/signoz/pkg/query-service/common/user.go
2024-09-02 22:47:30 +03:00

17 lines
315 B
Go

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
}