Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

Commit

Permalink
fix bug in authenticate related to logging in before account is verif…
Browse files Browse the repository at this point in the history
…ied. #496
  • Loading branch information
brockallen committed Feb 10, 2015
1 parent 270debb commit da3ad4f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2467,8 +2467,20 @@ public void SendUsernameReminder_EmailIsNotUnique_Fails()
Assert.Fail();
}
catch (InvalidOperationException) { }

}

[TestMethod]
public void Logging_in_before_account_is_verified_does_not_cause_account_to_have_last_login_set()
{
configuration.RequireAccountVerification = true;

var acct = subject.CreateAccount("test", "pass", "test@test.com");

var result = subject.Authenticate("test", "pass");
Assert.IsFalse(result);

acct = subject.GetByID(acct.ID);
Assert.IsTrue(acct.IsNew());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ protected virtual bool Authenticate(TAccount account, string password)
{
Tracing.Error("[UserAccountService.Authenticate] failed -- account not verified");
this.AddEvent(new AccountNotVerifiedEvent<TAccount>() { Account = account });
result = false;
return false;
}

Tracing.Verbose("[UserAccountService.Authenticate] authentication success");
Expand Down

0 comments on commit da3ad4f

Please # to comment.