summaryrefslogtreecommitdiffstats
path: root/TwoStepsAuthenticator.TestWebsite
diff options
context:
space:
mode:
authorChristoph Enzmann <christoph.enzmann@confer.ch>2013-12-06 15:03:39 +0100
committerChristoph Enzmann <christoph.enzmann@confer.ch>2013-12-06 15:03:39 +0100
commitff91ec6adbf7f1c816b645844e7f83f4be74e548 (patch)
tree479ebe1402da9137f33a9ce541557275935a69fc /TwoStepsAuthenticator.TestWebsite
parent30796603c880f5253e655789f4dfe71a170becf7 (diff)
downloadTwoStepsAuthenticator-ff91ec6adbf7f1c816b645844e7f83f4be74e548.zip
TwoStepsAuthenticator-ff91ec6adbf7f1c816b645844e7f83f4be74e548.tar.gz
TwoStepsAuthenticator-ff91ec6adbf7f1c816b645844e7f83f4be74e548.tar.bz2
Always use UsedCodeManager
Diffstat (limited to 'TwoStepsAuthenticator.TestWebsite')
-rw-r--r--TwoStepsAuthenticator.TestWebsite/Controllers/HomeController.cs5
1 files changed, 2 insertions, 3 deletions
diff --git a/TwoStepsAuthenticator.TestWebsite/Controllers/HomeController.cs b/TwoStepsAuthenticator.TestWebsite/Controllers/HomeController.cs
index ead9168..ca6666c 100644
--- a/TwoStepsAuthenticator.TestWebsite/Controllers/HomeController.cs
+++ b/TwoStepsAuthenticator.TestWebsite/Controllers/HomeController.cs
@@ -44,10 +44,9 @@ namespace TwoStepsAuthenticator.TestWebsite.Controllers
public ActionResult DoubleAuth(string code)
{
WebsiteUser user = (WebsiteUser)Session["AuthenticatedUser"];
- var auth = new TwoStepsAuthenticator.TimeAuthenticator();
- if (auth.CheckCode(user.DoubleAuthKey, code) && usedCodesManager.IsCodeUsed(user.DoubleAuthKey, code))
+ var auth = new TwoStepsAuthenticator.TimeAuthenticator(usedCodeManager: usedCodesManager);
+ if (auth.CheckCode(user.DoubleAuthKey, code))
{
- usedCodesManager.AddCode(user.DoubleAuthKey, code);
FormsAuthentication.SetAuthCookie(user.Login, true);
return RedirectToAction("Welcome");
}