diff --git a/src/Microsoft.AspNetCore.Authentication/AuthenticationMiddleware.cs b/src/Microsoft.AspNetCore.Authentication/AuthenticationMiddleware.cs index ad63b17614..a01490c3e4 100644 --- a/src/Microsoft.AspNetCore.Authentication/AuthenticationMiddleware.cs +++ b/src/Microsoft.AspNetCore.Authentication/AuthenticationMiddleware.cs @@ -73,7 +73,7 @@ namespace Microsoft.AspNetCore.Authentication await _next(context); } } - catch (Exception) + finally { try { @@ -81,9 +81,8 @@ namespace Microsoft.AspNetCore.Authentication } catch (Exception) { - // Don't mask the original exception + // Don't mask the original exception, if any } - throw; } }