Minor improvements (#1403)
* Fixed exception overwriting due to possible NullReferenceException * Removed unused local variables
This commit is contained in:
parent
eff1b42d6e
commit
241880eadc
|
|
@ -132,7 +132,6 @@ namespace Microsoft.AspNetCore.Authentication.Cookies
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentUtc = Clock.UtcNow;
|
var currentUtc = Clock.UtcNow;
|
||||||
var issuedUtc = ticket.Properties.IssuedUtc;
|
|
||||||
var expiresUtc = ticket.Properties.ExpiresUtc;
|
var expiresUtc = ticket.Properties.ExpiresUtc;
|
||||||
|
|
||||||
if (expiresUtc != null && expiresUtc.Value < currentUtc)
|
if (expiresUtc != null && expiresUtc.Value < currentUtc)
|
||||||
|
|
@ -246,7 +245,7 @@ namespace Microsoft.AspNetCore.Authentication.Cookies
|
||||||
_signInCalled = true;
|
_signInCalled = true;
|
||||||
|
|
||||||
// Process the request cookie to initialize members like _sessionKey.
|
// Process the request cookie to initialize members like _sessionKey.
|
||||||
var result = await EnsureCookieTicket();
|
await EnsureCookieTicket();
|
||||||
var cookieOptions = BuildCookieOptions();
|
var cookieOptions = BuildCookieOptions();
|
||||||
|
|
||||||
var signInContext = new CookieSigningInContext(
|
var signInContext = new CookieSigningInContext(
|
||||||
|
|
@ -328,7 +327,7 @@ namespace Microsoft.AspNetCore.Authentication.Cookies
|
||||||
_signOutCalled = true;
|
_signOutCalled = true;
|
||||||
|
|
||||||
// Process the request cookie to initialize members like _sessionKey.
|
// Process the request cookie to initialize members like _sessionKey.
|
||||||
var ticket = await EnsureCookieTicket();
|
await EnsureCookieTicket();
|
||||||
var cookieOptions = BuildCookieOptions();
|
var cookieOptions = BuildCookieOptions();
|
||||||
if (Options.SessionStore != null && _sessionKey != null)
|
if (Options.SessionStore != null && _sessionKey != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ namespace Microsoft.AspNetCore.Authentication
|
||||||
new InvalidOperationException("Invalid return state, unable to redirect.");
|
new InvalidOperationException("Invalid return state, unable to redirect.");
|
||||||
}
|
}
|
||||||
|
|
||||||
ticket = authResult.Ticket;
|
ticket = authResult?.Ticket;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue