1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 16:42:50 -05: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
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);
}