public async Task <IActionResult> ConnectTwitch() { var user = await _userManager.GetUserAsync(User); if (user == null) { throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'."); } int key = _connectionHandler.GenerateKey(user.Id); ViewData["key"] = key; return(View()); }