debug: add tenant context logging to GetProfile
This commit is contained in:
@@ -2,6 +2,7 @@ package handlers
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"aggios-app/backend/internal/repository"
|
||||
@@ -59,8 +60,13 @@ func (h *AgencyHandler) GetProfile(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// Get tenant from context (set by middleware)
|
||||
tenantID := r.Context().Value("tenantID")
|
||||
log.Printf("DEBUG GetProfile: tenantID from context = %v (type: %T)", tenantID, tenantID)
|
||||
|
||||
if tenantID == nil {
|
||||
http.Error(w, "Tenant not found", http.StatusUnauthorized)
|
||||
log.Printf("DEBUG GetProfile: tenantID is nil, checking subdomain from context")
|
||||
subdomain := r.Context().Value("subdomain")
|
||||
log.Printf("DEBUG GetProfile: subdomain = %v", subdomain)
|
||||
http.Error(w, "Tenant not found in context", http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user