Example #1
0
        public async Task <IActionResult> Login(AccountViewModel account)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Account userToVerify = await Task.FromResult(_context.Get(account.Username));

            if (userToVerify != null && userToVerify.PssWord == account.Password)
            {
                return(new OkObjectResult("You have been logged in."));
            }


            return(NotFound());
        }
Example #2
0
 public async Task <ActionResult <IEnumerable <Account> > > getAccounts()
 {
     return(await Task.FromResult(_context.Get()));
 }