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:
parent
d7e45fe0a3
commit
82b6216e95
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user