public async Task <ActionResult> Index(TeamAuthentication auth) { var data = await LabRepo.GetDomAssignment(auth.LabCode, auth.TeamAuth); var test = ContinueEditingAssignment(data); if (test != null) { ViewBag.ErrorHeader = test.ErrorHeader; ViewBag.Error = test.Error; ViewBag.IsLive = true; return(View("Index")); } var tenantId = AdalLib.GetUserTenantId(User.Identity); var tenantName = AdalLib.GetUserUPNSuffix(User.Identity); var tenantAdmin = User.Identity.GetClaim(ClaimTypes.Upn); var oid = User.Identity.GetClaim(TokenCacheClaimTypes.ObjectId); await LabRepo.UpdateTenantId(new TeamDTO { Lab = data.Lab, TeamAssignment = data.TeamAssignment }, tenantId, tenantName, tenantAdmin); return(RedirectToAction("refresh", "account")); }