Update MembershipHelper.cs

The parameter "logMemberIn" wasn't used so setting "LoginOnSuccess" on the RegisterModel didn't have any effect. By checking the parameter you can disable automatically logging in the user after registration. If registration failed, it would have returned null in an earlier stage so it's safe to say registration succeeded at this point.
This commit is contained in:
Odie20XX
2014-10-31 15:30:20 +01:00
parent f7cb188210
commit 468c281d7d

View File

@@ -172,11 +172,14 @@ namespace Umbraco.Web.Security
if (status != MembershipCreateStatus.Success) return null;
}
//Set member online
provider.GetUser(model.Username, true);
//Log them in
FormsAuthentication.SetAuthCookie(membershipUser.UserName, model.CreatePersistentLoginCookie);
if (logMemberIn)
{
//Set member online
provider.GetUser(model.Username, true);
//Log them in
FormsAuthentication.SetAuthCookie(membershipUser.UserName, model.CreatePersistentLoginCookie);
}
return membershipUser;
}