Rucha Pandya

Rucha Pandya

  • NA
  • 7
  • 642

I am trying to hash my password and then trying to store it

Feb 12 2016 6:03 AM
Below is my code and m trying to hash my password in mvc
 
but it is showing error like crypto not exists I m using vs2012 
 
 
public ActionResult Login(LoginViewModel model)
{
if (ModelState.IsValid)
{
var search = db.Logins.FirstOrDefault(x => x.UserEmail == model.UserEmail);
if (search != null)
{
if (Crypto.VerifyHashedPassword(search.UserPass, model.UserPass))
{
SessionWrapper.UserRole = search.Role.RoleName;
SessionWrapper.UserId = search.UserID;
SessionWrapper.UserEmail = search.UserEmail;
switch (SessionWrapper.UserRole)


case "Admin":
return Redirect("~/Admin/Dashboard");
break;
case "Customer":
return Redirect("~/Customer/Dashboard");
break;
case "Staff":
return Redirect("~/Staff/Dashboard");
break;

Answers (2)