public User SignIn(SigninView signinView) { User user = _db.Users .FirstOrDefault(u => u.Email == signinView.Email && u.Password == signinView.Password); return(user); }
public async Task <IActionResult> SignIn(SigninView model) { if (ModelState.IsValid) { User user = _userService.SignIn(model); if (user != null) { await Authenticate(user.Email, user.Id.ToString()); return(RedirectToAction("Index", "Home")); } ModelState.AddModelError("", "Wrong email and/or password"); } return(View(model)); }
public bool Exists(SigninView signinView) { return(_db.Users.FirstOrDefault(u => u.Email == signinView.Email) != null); }
public User(SigninView signinView) { Email = signinView.Email; Password = signinView.Password; }