summaryrefslogtreecommitdiffstats
path: root/TwoStepsAuthenticator.TestWebsite/Controllers/HomeController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'TwoStepsAuthenticator.TestWebsite/Controllers/HomeController.cs')
-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");
}