ProjectDetails_Split_API #103
@ -24,7 +24,7 @@ namespace MarcoBMS.Services.Middleware
|
|||||||
var response = context.Response;
|
var response = context.Response;
|
||||||
var request = context.Request;
|
var request = context.Request;
|
||||||
var tenantId = context.User.FindFirst("TenantId")?.Value;
|
var tenantId = context.User.FindFirst("TenantId")?.Value;
|
||||||
|
string origin = request.Headers["Origin"].FirstOrDefault() ?? "";
|
||||||
|
|
||||||
using (LogContext.PushProperty("TenantId", tenantId))
|
using (LogContext.PushProperty("TenantId", tenantId))
|
||||||
using (LogContext.PushProperty("TraceId", context.TraceIdentifier))
|
using (LogContext.PushProperty("TraceId", context.TraceIdentifier))
|
||||||
@ -33,6 +33,8 @@ namespace MarcoBMS.Services.Middleware
|
|||||||
using (LogContext.PushProperty("Timestamp", DateTime.UtcNow))
|
using (LogContext.PushProperty("Timestamp", DateTime.UtcNow))
|
||||||
using (LogContext.PushProperty("IpAddress", context.Connection.RemoteIpAddress?.ToString()))
|
using (LogContext.PushProperty("IpAddress", context.Connection.RemoteIpAddress?.ToString()))
|
||||||
using (LogContext.PushProperty("RequestPath", request.Path))
|
using (LogContext.PushProperty("RequestPath", request.Path))
|
||||||
|
using (LogContext.PushProperty("Origin", origin))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -218,7 +218,7 @@ namespace MarcoBMS.Services.Service
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
// Token is invalid
|
// Token is invalid
|
||||||
Console.WriteLine($"Token validation failed: {ex.Message}");
|
_logger.LogError($"Token validation failed: {ex.Message}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user