Ensures tempdata is set on our member controllers in the correct place and ensures that the RegisterModel doesn't explicitly set the RedirectUrl because we want it to be empty by default.

This commit is contained in:
Shannon
2015-08-27 14:56:42 +02:00
parent b550b9f9d1
commit e3598b99a5
5 changed files with 13 additions and 6 deletions

View File

@@ -25,6 +25,8 @@ namespace Umbraco.Web.Controllers
return CurrentUmbracoPage();
}
TempData["LoginSuccess"] = true;
//if there is a specified path to redirect to then use it
if (model.RedirectUrl.IsNullOrWhiteSpace() == false)
{
@@ -32,7 +34,7 @@ namespace Umbraco.Web.Controllers
}
//redirect to current page by default
TempData["LoginSuccess"] = true;
return RedirectToCurrentUmbracoPage();
//return RedirectToCurrentUmbracoUrl();
}

View File

@@ -24,6 +24,8 @@ namespace Umbraco.Web.Controllers
FormsAuthentication.SignOut();
}
TempData["LogoutSuccess"] = true;
//if there is a specified path to redirect to then use it
if (model.RedirectUrl.IsNullOrWhiteSpace() == false)
{
@@ -31,7 +33,7 @@ namespace Umbraco.Web.Controllers
}
//redirect to current page by default
TempData["LogoutSuccess"] = true;
return RedirectToCurrentUmbracoPage();
}
}

View File

@@ -36,14 +36,15 @@ namespace Umbraco.Web.Controllers
return CurrentUmbracoPage();
}
TempData["ProfileUpdateSuccess"] = true;
//if there is a specified path to redirect to then use it
if (model.RedirectUrl.IsNullOrWhiteSpace() == false)
{
return Redirect(model.RedirectUrl);
}
//redirect to current page by default
TempData["ProfileUpdateSuccess"] = true;
//redirect to current page by default
return RedirectToCurrentUmbracoPage();
}
}

View File

@@ -27,13 +27,16 @@ namespace Umbraco.Web.Controllers
switch (status)
{
case MembershipCreateStatus.Success:
TempData["FormSuccess"] = true;
//if there is a specified path to redirect to then use it
if (model.RedirectUrl.IsNullOrWhiteSpace() == false)
{
return Redirect(model.RedirectUrl);
}
//redirect to current page by default
TempData["FormSuccess"] = true;
return RedirectToCurrentUmbracoPage();
case MembershipCreateStatus.InvalidUserName:
ModelState.AddModelError((model.UsernameIsEmail || model.Username == null)

View File

@@ -28,7 +28,6 @@ namespace Umbraco.Web.Models
{
MemberTypeAlias = Constants.Conventions.MemberTypes.DefaultAlias;
RedirectOnSucces = false;
RedirectUrl = "/";
UsernameIsEmail = true;
MemberProperties = new List<UmbracoProperty>();
LoginOnSuccess = true;