1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

SetIdentityServerOrigin for all non-dev (#925)

This commit is contained in:
Kyle Spearrin 2020-09-09 14:47:52 -04:00 committed by GitHub
parent d7e45fe0a3
commit 82b6216e95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -87,7 +87,7 @@ namespace Bit.Sso
app.UseSerilog(env, appLifetime, globalSettings);
if (globalSettings.SelfHosted)
if (!env.IsDevelopment())
{
var uri = new Uri(globalSettings.BaseServiceUri.Sso);
app.Use(async (ctx, next) =>
@ -95,6 +95,10 @@ namespace Bit.Sso
ctx.SetIdentityServerOrigin($"{uri.Scheme}://{uri.Host}");
await next();
});
}
if (globalSettings.SelfHosted)
{
app.UsePathBase("/sso");
app.UseForwardedHeaders(globalSettings);
}

View File

@ -144,7 +144,7 @@ namespace Bit.Identity
app.UseSerilog(env, appLifetime, globalSettings);
if (globalSettings.SelfHosted)
if (!env.IsDevelopment())
{
var uri = new Uri(globalSettings.BaseServiceUri.Identity);
app.Use(async (ctx, next) =>
@ -152,6 +152,10 @@ namespace Bit.Identity
ctx.SetIdentityServerOrigin($"{uri.Scheme}://{uri.Host}");
await next();
});
}
if (globalSettings.SelfHosted)
{
app.UsePathBase("/identity");
app.UseForwardedHeaders(globalSettings);
}