Ejemplo n.º 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"));
        }
Ejemplo n.º 2
0
        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"));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Edit(AccountUser acco, string submitAction)
        {
            //if (submitAction.Equals("Delete Account"))
            //return RedirectToAction("Delete", new { AccountUserId = accountUser.AccountUserId });
            if (submitAction.Equals("Login"))
            {
                AccountUser account = await _accountRepo.GetByEmail(acco);

                if (acco != null)
                {
                    if (DoesPasswordMatch(account.PasswordHash, acco.PasswordHash))
                    {
                        //Success
                        userAuth = acco;
                        return(RedirectToAction("Index", "Login"));
                    }
                    else
                    {
                        return(RedirectToRoute("/Login/Index"));
                    }
                }
            }
            return(RedirectToRoute("/Login/Index"));
        }