public async Task <User> Login(string username, string password) { var user = await _context.Users.FirstOrDefaultAsync(x => x.Username == username); if (user == null) { return(null); } return(!(UserAuthorization.VerifyPasswordHash(password, user.PasswordHash, user.PasswordSalt)) ? null : user); }