public async Task <IActionResult> Login(LoginUser login) { var db = new SimpleTodoDbContext(); var user = db.Users .Where(u => u.LoginName == login.Name && u.Password == login.Password) .FirstOrDefault(); if (user != null) { var claims = new List <Claim> { new Claim(ClaimTypes.Name, user.LoginName) }; var claimsIdentity = new ClaimsIdentity( claims, CookieAuthenticationDefaults.AuthenticationScheme); await HttpContext.SignInAsync( CookieAuthenticationDefaults.AuthenticationScheme, new ClaimsPrincipal(claimsIdentity)); //return Redirect("/Lists"); return(Redirect("/Lists/Start")); //old prj not nav bar } return(View()); }
public TodoTasksController(SimpleTodoDbContext context) { _context = context; }
public ListsController(SimpleTodoDbContext context) { _context = context; }
public UsersController(SimpleTodoDbContext context) { _context = context; }