#307 Assume notifications are not null.

This commit is contained in:
Chris R 2015-09-02 11:35:18 -07:00
parent 4b1f710c39
commit 0f115f1fda
1 changed files with 37 additions and 43 deletions

View File

@ -89,8 +89,6 @@ namespace Microsoft.AspNet.Authentication.OpenIdConnect
message.PostLogoutRedirectUri = Options.PostLogoutRedirectUri; message.PostLogoutRedirectUri = Options.PostLogoutRedirectUri;
} }
if (Options.Notifications.RedirectToIdentityProvider != null)
{
var redirectToIdentityProviderNotification = new RedirectToIdentityProviderNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions>(Context, Options) var redirectToIdentityProviderNotification = new RedirectToIdentityProviderNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions>(Context, Options)
{ {
ProtocolMessage = message ProtocolMessage = message
@ -109,7 +107,6 @@ namespace Microsoft.AspNet.Authentication.OpenIdConnect
} }
message = redirectToIdentityProviderNotification.ProtocolMessage; message = redirectToIdentityProviderNotification.ProtocolMessage;
}
if (Options.AuthenticationMethod == OpenIdConnectAuthenticationMethod.RedirectGet) if (Options.AuthenticationMethod == OpenIdConnectAuthenticationMethod.RedirectGet)
{ {
@ -223,8 +220,6 @@ namespace Microsoft.AspNet.Authentication.OpenIdConnect
} }
} }
if (Options.Notifications.RedirectToIdentityProvider != null)
{
var redirectToIdentityProviderNotification = var redirectToIdentityProviderNotification =
new RedirectToIdentityProviderNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions>(Context, Options) new RedirectToIdentityProviderNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions>(Context, Options)
{ {
@ -249,7 +244,6 @@ namespace Microsoft.AspNet.Authentication.OpenIdConnect
} }
message = redirectToIdentityProviderNotification.ProtocolMessage; message = redirectToIdentityProviderNotification.ProtocolMessage;
}
var redirectUriForCode = message.RedirectUri; var redirectUriForCode = message.RedirectUri;
if (string.IsNullOrEmpty(redirectUriForCode)) if (string.IsNullOrEmpty(redirectUriForCode))