Removed redundant if checks (#1390)
This commit is contained in:
parent
414d596639
commit
c8a99e5806
|
|
@ -142,7 +142,7 @@ namespace Microsoft.AspNetCore.Authentication
|
||||||
Logger.AuthenticationSchemeNotAuthenticated(Scheme.Name);
|
Logger.AuthenticationSchemeNotAuthenticated(Scheme.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (result?.Failure != null)
|
else
|
||||||
{
|
{
|
||||||
Logger.AuthenticationSchemeNotAuthenticatedWithFailure(Scheme.Name, result.Failure.Message);
|
Logger.AuthenticationSchemeNotAuthenticatedWithFailure(Scheme.Name, result.Failure.Message);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1325,11 +1325,11 @@ namespace Microsoft.AspNetCore.Authentication.Cookies
|
||||||
res.StatusCode = 200;
|
res.StatusCode = 200;
|
||||||
res.ContentType = "text/xml";
|
res.ContentType = "text/xml";
|
||||||
var xml = new XElement("xml");
|
var xml = new XElement("xml");
|
||||||
if (result != null && result?.Ticket?.Principal != null)
|
if (result?.Ticket?.Principal != null)
|
||||||
{
|
{
|
||||||
xml.Add(result.Ticket.Principal.Claims.Select(claim => new XElement("claim", new XAttribute("type", claim.Type), new XAttribute("value", claim.Value))));
|
xml.Add(result.Ticket.Principal.Claims.Select(claim => new XElement("claim", new XAttribute("type", claim.Type), new XAttribute("value", claim.Value))));
|
||||||
}
|
}
|
||||||
if (result != null && result?.Ticket?.Properties != null)
|
if (result?.Ticket?.Properties != null)
|
||||||
{
|
{
|
||||||
xml.Add(result.Ticket.Properties.Items.Select(extra => new XElement("extra", new XAttribute("type", extra.Key), new XAttribute("value", extra.Value))));
|
xml.Add(result.Ticket.Properties.Items.Select(extra => new XElement("extra", new XAttribute("type", extra.Key), new XAttribute("value", extra.Value))));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue