public async Task <bool> CheckPasswordAsync(Users user, string password) { try { if (user == null) { return(false); } var userPassword = await _userData.CheckPasswordAsync(user); if (userPassword.Count <= 0) { return(false); } // check a password var validPassword = BCrypt.Net.BCrypt.Verify(password, userPassword[0].Password); return(validPassword); } catch (Exception e) { throw e; } }