diff --git a/src/Controllers/HomeController.cs b/src/Controllers/HomeController.cs index 736d34ab..1fcb32b4 100644 --- a/src/Controllers/HomeController.cs +++ b/src/Controllers/HomeController.cs @@ -68,7 +68,7 @@ public async Task Index() model.AppPath = _localPlatformSettings.AppRepositoryBasePath; model.StaticTestDataPath = _localPlatformSettings.LocalTestingStaticTestDataPath; model.LocalAppUrl = _localPlatformSettings.LocalAppUrl; - var defaultAuthLevel = _localPlatformSettings.LocalAppMode == "http" ? await GetAppAuthLevel(model.TestApps.First().Value) : 2; + var defaultAuthLevel = _localPlatformSettings.LocalAppMode == "http" ? await GetAppAuthLevel(model.TestApps) : 2; model.AuthenticationLevels = GetAuthenticationLevels(defaultAuthLevel); if (!model.TestApps?.Any() ?? true) @@ -224,9 +224,10 @@ private async Task> GetTestUsersForList() return userItems; } - private async Task GetAppAuthLevel(string appId) + private async Task GetAppAuthLevel(IEnumerable testApps) { try { + var appId = testApps.Single().Value; var policyString = await _localApp.GetXACMLPolicy(appId); var document = new XmlDocument(); document.LoadXml(policyString); @@ -237,7 +238,7 @@ private async Task GetAppAuthLevel(string appId) } catch(Exception) { - // Return default auth level if app auth level can't be found. + // Return default auth level if Single app auth level can't be found. return 2; } }