Skip to content

Commit

Permalink
Enable swagger in all environments
Browse files Browse the repository at this point in the history
  • Loading branch information
tsundvoll committed Apr 18, 2023
1 parent d65a8d7 commit 473e104
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions backend/api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,21 @@

var app = builder.Build();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment() || app.Environment.IsStaging())
{
app.UseSwagger();
app.UseSwaggerUI(
c =>
{
c.OAuthClientId(builder.Configuration["AzureAd:ClientId"]);
// The following parameter represents the "audience" of the access token.
c.OAuthAdditionalQueryStringParams(
new Dictionary<string, string>
{
{ "Resource", builder.Configuration["AzureAd:ClientId"] }
}
);
c.OAuthUsePkce();
}
);
}
app.UseSwagger();
app.UseSwaggerUI(
c =>
{
c.OAuthClientId(builder.Configuration["AzureAd:ClientId"]);
// The following parameter represents the "audience" of the access token.
c.OAuthAdditionalQueryStringParams(
new Dictionary<string, string>
{
{ "Resource", builder.Configuration["AzureAd:ClientId"] }
}
);
c.OAuthUsePkce();
}
);

app.UseCors(
corsBuilder =>
Expand Down

0 comments on commit 473e104

Please sign in to comment.