コード例 #1
0
 public ActionResult WriterLogin(WriterForLoginDto writer)
 {
     if ((wm.Login(writer)))
     {
         FormsAuthentication.SetAuthCookie(writer.Email, false);
         Session["Writermail"] = writer.Email.ToString();
         return(RedirectToAction("MyContent", "WriterPanelContent"));
     }
     else
     {
         return(View());
     }
 }
コード例 #2
0
        public bool Login(WriterForLoginDto writer)
        {
            var userToCheck = _writerDal.Get(x => x.WriterMail == writer.Email);

            if (userToCheck == null)
            {
                return(false);
            }
            if (!HashingHelper.VerifyPasswordHash(writer.Password, userToCheck.PasswordHash, userToCheck.PasswordSalt))
            {
                return(false);
            }
            return(true);
        }