private static bool ConfirmAccount(string accountConfirmationToken, User user, IDocumentSession session)
 {
     if (user == null)
     {
         return false;
     }
     user.IsApproved = user.ConfirmationToken == accountConfirmationToken;
     session.SaveChanges();
     return user.IsApproved;
 }
 private bool UserEqual(RegisterModel expected, User actual)
 {
     return expected.Email == actual.Username &&
            expected.Role == actual.Roles[0];
 }
 public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
 {
     var user = new User(username, HashPassword(password), email, passwordQuestion, passwordAnswer, isApproved);
     using (var session = documentStore.OpenSession())
     {
         session.Store(user);
         session.SaveChanges();
         status = MembershipCreateStatus.Success;
         return new BirdBrainMembershipUser(user);
     }
 }
 public BirdBrainMembershipUser(User user)
     : base(BirdBrainMembershipProvider.ProviderName, user.Username, user.Id, user.Email, user.PasswordQuestion, user.Comment,
         user.IsApproved, false,
         user.Created, user.LastLogin, user.LastActive, user.LastPasswordChange, user.LastLockedOut)
 {
 }