package member

import (
	"context"
	"net/http"

	logic "gateway/internal/logic/member"
)

func actorContext(ctx context.Context, r *http.Request) context.Context {
	if _, err := logic.ActorFromContext(ctx); err == nil {
		return ctx
	}
	return logic.WithActor(ctx, r.Header.Get("X-Tenant-ID"), r.Header.Get("X-UID"))
}
