From 123b59506bd70c2248abfe8eeaf97af6844c6e07 Mon Sep 17 00:00:00 2001 From: Scott Brady Date: Thu, 30 Apr 2020 08:50:56 +0100 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: Bjarke Berg --- src/Umbraco.Web/Security/AppBuilderExtensions.cs | 2 +- src/Umbraco.Web/Security/IdentityFactoryMiddleware.cs | 2 +- src/Umbraco.Web/Security/UmbracoSecurityStampValidator.cs | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web/Security/AppBuilderExtensions.cs b/src/Umbraco.Web/Security/AppBuilderExtensions.cs index 9c929704e5..6865bd696b 100644 --- a/src/Umbraco.Web/Security/AppBuilderExtensions.cs +++ b/src/Umbraco.Web/Security/AppBuilderExtensions.cs @@ -430,7 +430,7 @@ namespace Umbraco.Web.Security { if (app == null) { - throw new ArgumentNullException("app"); + throw new ArgumentNullException(nameof(app)); } return app.CreatePerOwinContext(createCallback, (options, instance) => instance.Dispose()); } diff --git a/src/Umbraco.Web/Security/IdentityFactoryMiddleware.cs b/src/Umbraco.Web/Security/IdentityFactoryMiddleware.cs index ddd0703878..d091a51624 100644 --- a/src/Umbraco.Web/Security/IdentityFactoryMiddleware.cs +++ b/src/Umbraco.Web/Security/IdentityFactoryMiddleware.cs @@ -22,7 +22,7 @@ namespace Umbraco.Web.Security { if (options == null) { - throw new ArgumentNullException("options"); + throw new ArgumentNullException(nameof(options)); } if (options.Provider == null) { diff --git a/src/Umbraco.Web/Security/UmbracoSecurityStampValidator.cs b/src/Umbraco.Web/Security/UmbracoSecurityStampValidator.cs index a5f9c17765..1264b5f62e 100644 --- a/src/Umbraco.Web/Security/UmbracoSecurityStampValidator.cs +++ b/src/Umbraco.Web/Security/UmbracoSecurityStampValidator.cs @@ -24,11 +24,7 @@ namespace Umbraco.Web.Security return async context => { - var currentUtc = DateTimeOffset.UtcNow; - if (context.Options != null && context.Options.SystemClock != null) - { - currentUtc = context.Options.SystemClock.UtcNow; - } + var currentUtc = context.Options?.SystemClock?.UtcNow ?? DateTimeOffset.UtcNow; var issuedUtc = context.Properties.IssuedUtc;