Skip to content

Commit

Permalink
OrchardCMS#808 Fixes after Nicholas and Wojciech reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
rserj committed Jul 25, 2017
1 parent 4cb7755 commit 2323dfb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ public Task BindModelAsync(ModelBindingContext bindingContext)
{
var valueAsString = valueProviderResult.FirstValue;

if (string.IsNullOrEmpty(valueAsString))
{
return TaskCache.CompletedTask;
}

if (!string.IsNullOrEmpty(valueAsString))
{
var origins = valueAsString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ public OpenIdCorsConfiguration(OpenIdApplicationStore openIdService)

public void Configure(CorsOptions options)
{
var openIdApplications = _openIdApplicationStore.GetAllApps().GetAwaiter().GetResult();
if (openIdApplications == null || !openIdApplications.Any()) return;
var openIdApplications = _openIdApplicationStore.GetAllApps().GetAwaiter().GetResult().ToList();
if (openIdApplications == null || openIdApplications.Count==0) return;
var appOrigins = openIdApplications
.Where(app => (app.AllowPasswordFlow || app.AllowClientCredentialsFlow || app.AllowRefreshTokenFlow)
&& app.AllowedOrigins != null && app.AllowedOrigins.Any())
.SelectMany(app => app.AllowedOrigins)
.ToArray();
if (!appOrigins.Any()) return;
if (appOrigins.Length == 0)
{
return;
}

//Auth end-points policy
options.AddPolicy(Constants.OpenIdConnectAuthPolicy, builder => builder
Expand Down
2 changes: 1 addition & 1 deletion src/OrchardCore/OrchardCore.Cms/OrchardCore.Cms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
-->

<ItemGroup>
<ProjectReference Include="..\..\OrchardCore.Modules\Orchard.Cors\Orchard.Cors.csproj" />
<ProjectReference Include="..\..\OrchardCore.Modules\Orchard.Cors\Orchard.Cors.csproj" PrivateAssets="none" />
<ProjectReference Include="..\..\OrchardCore.Modules\Orchard.Queries\Orchard.Queries.csproj" />
<ProjectReference Include="..\OrchardCore.AsBundle\OrchardCore.AsBundle.csproj" PrivateAssets="none" />
<ProjectReference Include="..\..\OrchardCore.Modules\Orchard.Admin\Orchard.Admin.csproj" PrivateAssets="none" />
Expand Down

0 comments on commit 2323dfb

Please sign in to comment.