Exemple #1
0
        public async Task <IActionResult> Index(AccountUser accountUser)
        {
            AccountUser acco = await _accountUserRepo.GetByEmail(accountUser);

            if (acco != null)
            {
                if (passwordHash.DoesPasswordMatch(acco.PasswordHash, acco.LoginEmail))
                {
                    return(RedirectToRoute("/Shelter/Index"));
                }
            }
            return(RedirectToAction("Login", "Account"));
        }
        public async Task <IActionResult> Login(AccountUser accountUser)
        {
            //if (submitAction.Equals("Delete Account"))
            //return RedirectToAction("Delete", new { AccountUserId = accountUser.AccountUserId });
            AccountUser acco = await _accountUserRepo.GetByEmail(accountUser);

            if (acco != null)
            {
                if (passhash.DoesPasswordMatch(acco.PasswordHash, accountUser.PasswordHash))
                {
                    //Success
                    PasswordHash.userauth = acco;
                    return(RedirectToAction("Index", "Shelter"));
                }
                else
                {
                    return(RedirectToAction("Login", "Account"));
                }
            }
            return(RedirectToAction("Login", "Account"));
        }