public ActionResult Login(SignInLoginVM signInLoginVM) { if (ModelState.IsValid) { HashedLoginVM hashedLoginVM = new HashedLoginVM() { Username = signInLoginVM.Username, Password = Utils.HashUtils.ComputeHash(signInLoginVM.Password) }; if (_userLogic.Login(_mapper.Map <User>(hashedLoginVM))) { FormsAuthentication.SetAuthCookie(signInLoginVM.Username, true); return(RedirectToAction("Index", "PrintEdition")); } } return(View()); }
public ActionResult Register(CreateLoginVM createLoginVM) { if (ModelState.IsValid) { try { HashedLoginVM hashedLoginVM = new HashedLoginVM() { Username = createLoginVM.Username, Password = Utils.HashUtils.ComputeHash(createLoginVM.Password) }; _userLogic.AddUser(_mapper.Map <User>(hashedLoginVM)); return(RedirectToAction("Login", "Account")); } catch (Exception ex) { Logger.Error(ex.Message); return(View()); } } return(View()); }