Apply suggestions from code review

Co-Authored-By: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
Scott Brady
2020-04-30 08:50:56 +01:00
committed by GitHub
parent d08bb08f57
commit 123b59506b
3 changed files with 3 additions and 7 deletions

View File

@@ -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());
}

View File

@@ -22,7 +22,7 @@ namespace Umbraco.Web.Security
{
if (options == null)
{
throw new ArgumentNullException("options");
throw new ArgumentNullException(nameof(options));
}
if (options.Provider == null)
{

View File

@@ -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;