示例#1
0
        //[HttpPost]
        //[WebMethod]
        public bool VerifyAuth(string code) //FormCollection fc)
        {
            TwoFactorAuthenticator tfa = new TwoFactorAuthenticator();
            string useruniquekey       = Convert.ToString(Session["UserId"]) + Session["UserName"];
            bool   isvalid             = tfa.ValidateTwoFactorPIN(useruniquekey, code);

            return(isvalid && objProfileMod.Save2FA(Convert.ToInt32(Session["UserId"]), isvalid) > 0);
        }