Fix bad merge

This commit is contained in:
Javier Calvarro Nelson 2018-02-09 14:08:01 -08:00
parent 6bb798d2b7
commit 025d366b83
1 changed files with 31 additions and 8 deletions

View File

@ -21,7 +21,7 @@ namespace Company.WebApplication1.Controllers
[HttpGet] [HttpGet]
public IActionResult SignIn() public IActionResult SignIn()
{ {
var redirectUrl = Url.Page("/Index"); var redirectUrl = Url.Action(nameof(HomeController.Index), "Home");
return Challenge( return Challenge(
new AuthenticationProperties { RedirectUri = redirectUrl }, new AuthenticationProperties { RedirectUri = redirectUrl },
OpenIdConnectDefaults.AuthenticationScheme OpenIdConnectDefaults.AuthenticationScheme
@ -31,12 +31,24 @@ namespace Company.WebApplication1.Controllers
[HttpGet] [HttpGet]
public IActionResult SignOut() public IActionResult SignOut()
{ {
var callbackUrl = Url.Page("/Account/SignedOut", pageHandler: null, values: null, protocol: Request.Scheme); var callbackUrl = Url.Action(nameof(SignedOut), "Account", values: null, protocol: Request.Scheme);
return SignOut( return SignOut(
new AuthenticationProperties { RedirectUri = callbackUrl }, new AuthenticationProperties { RedirectUri = callbackUrl },
CookieAuthenticationDefaults.AuthenticationScheme, OpenIdConnectDefaults.AuthenticationScheme CookieAuthenticationDefaults.AuthenticationScheme, OpenIdConnectDefaults.AuthenticationScheme
); );
} }
[HttpGet]
public IActionResult SignedOut()
{
if (User.Identity.IsAuthenticated)
{
// Redirect to home page if the user is authenticated.
return RedirectToAction(nameof(HomeController.Index), "Home");
}
return View();
}
#elseif (IndividualB2CAuth) #elseif (IndividualB2CAuth)
private readonly AzureAdB2COptions _options; private readonly AzureAdB2COptions _options;
@ -48,7 +60,7 @@ namespace Company.WebApplication1.Controllers
[HttpGet] [HttpGet]
public IActionResult SignIn() public IActionResult SignIn()
{ {
var redirectUrl = Url.Page("/Index"); var redirectUrl = Url.Action(nameof(HomeController.Index), "Home");
return Challenge( return Challenge(
new AuthenticationProperties { RedirectUri = redirectUrl }, new AuthenticationProperties { RedirectUri = redirectUrl },
OpenIdConnectDefaults.AuthenticationScheme OpenIdConnectDefaults.AuthenticationScheme
@ -58,7 +70,7 @@ namespace Company.WebApplication1.Controllers
[HttpGet] [HttpGet]
public IActionResult ResetPassword() public IActionResult ResetPassword()
{ {
var redirectUrl = Url.Page("/Index"); var redirectUrl = Url.Action(nameof(HomeController.Index), "Home");
var properties = new AuthenticationProperties { RedirectUri = redirectUrl }; var properties = new AuthenticationProperties { RedirectUri = redirectUrl };
properties.Items[AzureAdB2COptions.PolicyAuthenticationProperty] = _options.ResetPasswordPolicyId; properties.Items[AzureAdB2COptions.PolicyAuthenticationProperty] = _options.ResetPasswordPolicyId;
return Challenge(properties, OpenIdConnectDefaults.AuthenticationScheme); return Challenge(properties, OpenIdConnectDefaults.AuthenticationScheme);
@ -67,7 +79,7 @@ namespace Company.WebApplication1.Controllers
[HttpGet] [HttpGet]
public IActionResult EditProfile() public IActionResult EditProfile()
{ {
var redirectUrl = Url.Page("/Index"); var redirectUrl = Url.Action(nameof(HomeController.Index), "Home");
var properties = new AuthenticationProperties { RedirectUri = redirectUrl }; var properties = new AuthenticationProperties { RedirectUri = redirectUrl };
properties.Items[AzureAdB2COptions.PolicyAuthenticationProperty] = _options.EditProfilePolicyId; properties.Items[AzureAdB2COptions.PolicyAuthenticationProperty] = _options.EditProfilePolicyId;
return Challenge(properties, OpenIdConnectDefaults.AuthenticationScheme); return Challenge(properties, OpenIdConnectDefaults.AuthenticationScheme);
@ -76,12 +88,23 @@ namespace Company.WebApplication1.Controllers
[HttpGet] [HttpGet]
public IActionResult SignOut() public IActionResult SignOut()
{ {
var callbackUrl = Url.Page("/Account/SignedOut", pageHandler: null, values: null, protocol: Request.Scheme); var callbackUrl = Url.Action(nameof(SignedOut), "Account", values: null, protocol: Request.Scheme);
return SignOut( return SignOut(
new AuthenticationProperties { RedirectUri = callbackUrl }, new AuthenticationProperties { RedirectUri = callbackUrl },
CookieAuthenticationDefaults.AuthenticationScheme, CookieAuthenticationDefaults.AuthenticationScheme,
OpenIdConnectDefaults.AuthenticationScheme OpenIdConnectDefaults.AuthenticationScheme);
); }
[HttpGet]
public IActionResult SignedOut()
{
if (User.Identity.IsAuthenticated)
{
// Redirect to home page if the user is authenticated.
return RedirectToAction(nameof(HomeController.Index), "Home");
}
return View();
} }
#endif #endif