Skip to content

Commit

Permalink
password question and password answer must be set before calling Regi…
Browse files Browse the repository at this point in the history
…ster of AccountRepository

I have set IsPasswordQuestionRequired in PasswordPolicy to true. but when MembershipProvider calls Register of AccountRepository Password question and answer are both null. While I have passed them to membership provider through calling Membership.CreateUser.
  • Loading branch information
alisabzevari committed Sep 18, 2013
1 parent 75a7468 commit 33e525b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ public override MembershipUser CreateUser(string username, string password, stri
var passwordInfo = new AccountPasswordInfo(username, password);
account.Password = PasswordStrategy.Encrypt(passwordInfo);
account.PasswordSalt = passwordInfo.PasswordSalt;

account.PasswordAnswer = passwordAnswer;
account.PasswordQuestion = passwordQuestion;

status = AccountRepository.Register(account);
if (status == MembershipCreateStatus.Success)
Expand Down Expand Up @@ -629,4 +632,4 @@ public override MembershipUserCollection FindUsersByEmail(string emailToMatch, i
return CloneUsers(users);
}
}
}
}

0 comments on commit 33e525b

Please sign in to comment.