public async Task <IActionResult> GetUser([FromQuery] string user) { if (user == null) { return(ErrorViewModel.IsEmptyUser()); } var checkUser = await GetIdentityUser(user); if (checkUser == null) { return(ErrorViewModel.NotFoundUser()); } var resultCheck = new { id = checkUser.Id, foundUser = checkUser.Login }; return(Json(resultCheck)); }
public async Task <IActionResult> GetUser([FromBody] UserCheckModel user) { string userNameTo = user.UserNameTo; if (userNameTo == "") { return(ErrorViewModel.IsEmptyUser()); } var checkUser = await GetIdentityUser(userNameTo); if (checkUser == null) { return(ErrorViewModel.NotFoundUser()); } var resultCheck = new { id = checkUser.Id, foundUser = checkUser.Login }; return(Json(resultCheck)); }
public async Task <IActionResult> RememberPassword(string param) { User sResult; if (param != "") { if (param.IndexOf("@") >= 0) { sResult = await db.Users.FirstOrDefaultAsync(p => p.Email == param); return(Ok()); } else { sResult = await db.Users.FirstOrDefaultAsync(p => p.Login == param); return(Ok()); } } return(ErrorViewModel.NotFoundUser()); }