Asp.net mvc 4: simplemembership - WebSecurity.Login fails when user is not verified

By default, the WebSecurity.Login method returns false when the user is not verified. How can I get it to work regardless of the user's confirmation status?

+3


source to share


1 answer


If confirmation is not important to you, then when you call CreateUserAndAccount () or CreateAccount () make sure you pass requireConfirmationToken as false.

This way, once the account is created, it will not ask for confirmation and Login () should work with correct credentials.



EDIT: The general need for confirmation is to make sure you have a reliable way to communicate with the user (such as an email address) in case the user has forgotten their password. Without confirmation, you will not have such "verified" means of communication. You can also try flipping the bits in the webpages_Membership database (IsConfirmed == 1), but I wouldn't recommend that either.

+1


source







All Articles