public override string ResetPassword(string userName, string answer)
{
Condition.Requires(userName, "userName").IsNotNullOrEmpty();
if (!string.IsNullOrWhiteSpace(answer))
{
throw new NotSupportedException("answer is not supported, pass an empty string or null");
}
var newPassword =
Membership.GeneratePassword(
this.MinRequiredPasswordLength < PasswordSize ? PasswordSize : this.MinRequiredPasswordLength,
this.MinRequiredNonAlphanumericCharacters);
if (!this.HasLocalAccount(this.GetUserId(userName)))
{
this.CreateAccount(userName, newPassword, false);
return newPassword;
}
return this.ResetPasswordAndUnlock(userName, newPassword) ? newPassword : null;
}