Files
geo/server/internal/tenant/app/current_brand.go
T
2026-05-20 15:37:25 +08:00

16 lines
404 B
Go

package app
import (
"context"
"github.com/geo-platform/tenant-api/internal/shared/auth"
"github.com/geo-platform/tenant-api/internal/shared/response"
)
func requireCurrentBrandID(ctx context.Context) (int64, error) {
if brandID, ok := auth.CurrentBrandIDFromCtx(ctx); ok {
return brandID, nil
}
return 0, response.ErrBadRequest(40033, "brand_context_required", "current brand is required")
}