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()); } }
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); }