fix(backend): correct webhook session URL to /sessions/{id}

Webhook notifications built /session/{tenantId}/{sessionId}, which is a
dead route (404). The web app route is /sessions/{sessionId} (plural,
single segment); tenant is resolved from the session, not the path.
Fixes broken "Open session" links in enrollment-started and
success/failure notifications.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Oliver Kieselbach
2026-06-19 10:54:43 +02:00
parent 04c2482f33
commit b71df9fc18
3 changed files with 3 additions and 3 deletions
@@ -871,7 +871,7 @@ namespace AutopilotMonitor.Functions.Functions.Ingest
var providerType = (WebhookProviderType)providerTypeInt;
var sessionUrl = updatedSession != null
? $"https://portal.autopilotmonitor.com/session/{request.TenantId}/{request.SessionId}"
? $"https://portal.autopilotmonitor.com/sessions/{request.SessionId}"
: null;
// Enrollment completion/failure notification
@@ -251,7 +251,7 @@ namespace AutopilotMonitor.Functions.Functions.Sessions
if (string.IsNullOrEmpty(webhookUrl) || providerTypeInt == 0)
return;
var sessionUrl = $"https://portal.autopilotmonitor.com/session/{tenantId}/{sessionId}";
var sessionUrl = $"https://portal.autopilotmonitor.com/sessions/{sessionId}";
var alert = NotificationAlertBuilder.BuildEnrollmentStartedAlert(
session.DeviceName,
session.SerialNumber,
@@ -28,7 +28,7 @@ namespace AutopilotMonitor.Functions.Services
var providerType = (WebhookProviderType)providerTypeInt;
var sessionUrl = updatedSession != null
? $"https://portal.autopilotmonitor.com/session/{request.TenantId}/{request.SessionId}"
? $"https://portal.autopilotmonitor.com/sessions/{request.SessionId}"
: null;
if (statusTransitioned && (c.CompletionEvent != null || c.FailureEvent != null))