From 845d3dcf3f49e22ad565d744be7e3dfd67908e80 Mon Sep 17 00:00:00 2001 From: Piotr Gankiewicz Date: Sun, 3 Nov 2019 19:19:29 +0100 Subject: [PATCH] Fixed middleware --- src/DShop.Common/Authentication/Extensions.cs | 3 ++- src/DShop.Common/Jaeger/JaegerStagedMiddleware.cs | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/DShop.Common/Authentication/Extensions.cs b/src/DShop.Common/Authentication/Extensions.cs index c46f133..941184e 100644 --- a/src/DShop.Common/Authentication/Extensions.cs +++ b/src/DShop.Common/Authentication/Extensions.cs @@ -34,7 +34,8 @@ public static void AddJwt(this IServiceCollection services) ValidIssuer = options.Issuer, ValidAudience = options.ValidAudience, ValidateAudience = options.ValidateAudience, - ValidateLifetime = options.ValidateLifetime + ValidateLifetime = options.ValidateLifetime, + ClockSkew = TimeSpan.Zero }; }); } diff --git a/src/DShop.Common/Jaeger/JaegerStagedMiddleware.cs b/src/DShop.Common/Jaeger/JaegerStagedMiddleware.cs index 96e27d9..f79d20a 100644 --- a/src/DShop.Common/Jaeger/JaegerStagedMiddleware.cs +++ b/src/DShop.Common/Jaeger/JaegerStagedMiddleware.cs @@ -22,7 +22,7 @@ public JaegerStagedMiddleware(ITracer tracer) public override string StageMarker => RawRabbit.Pipe.StageMarker.MessageDeserialized; - public override Task InvokeAsync(IPipeContext context, CancellationToken token = new CancellationToken()) + public override async Task InvokeAsync(IPipeContext context, CancellationToken token = new CancellationToken()) { var correlationContext = (ICorrelationContext) context.GetMessageContext(); var messageType = context.GetMessageType(); @@ -34,7 +34,7 @@ public override Task InvokeAsync(IPipeContext context, CancellationToken token = try { - return Next.InvokeAsync(context, token); + await Next.InvokeAsync(context, token); } catch(Exception ex) { @@ -42,8 +42,6 @@ public override Task InvokeAsync(IPipeContext context, CancellationToken token = span.Log(ex.Message); } } - - return Next.Next.InvokeAsync(context, token); } private IScope BuildScope(Type messageType, string serializedSpanContext)