mirror of
https://github.com/bitwarden/server
synced 2025-12-15 15:53:59 +00:00
allow web vault origin for cors requests
This commit is contained in:
@@ -160,7 +160,9 @@ namespace Bit.Api
|
||||
app.UseStaticFiles();
|
||||
|
||||
// Add Cors
|
||||
app.UseCors(policy => policy.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader().AllowCredentials());
|
||||
app.UseCors(policy => policy
|
||||
.WithOrigins(globalSettings.BaseServiceUri.Vault)
|
||||
.AllowAnyMethod().AllowAnyHeader().AllowCredentials());
|
||||
|
||||
// Add authentication to the request pipeline.
|
||||
app.UseAuthentication();
|
||||
|
||||
@@ -94,7 +94,9 @@ namespace Bit.Events
|
||||
app.UseDefaultMiddleware(env);
|
||||
|
||||
// Add Cors
|
||||
app.UseCors(policy => policy.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader().AllowCredentials());
|
||||
app.UseCors(policy => policy
|
||||
.WithOrigins(globalSettings.BaseServiceUri.Vault)
|
||||
.AllowAnyMethod().AllowAnyHeader().AllowCredentials());
|
||||
|
||||
// Add authentication to the request pipeline.
|
||||
app.UseAuthentication();
|
||||
|
||||
@@ -94,7 +94,9 @@ namespace Bit.Notifications
|
||||
}
|
||||
|
||||
// Add Cors
|
||||
app.UseCors(policy => policy.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader().AllowCredentials());
|
||||
app.UseCors(policy => policy
|
||||
.WithOrigins(globalSettings.BaseServiceUri.Vault)
|
||||
.AllowAnyMethod().AllowAnyHeader().AllowCredentials());
|
||||
|
||||
// Add authentication to the request pipeline.
|
||||
app.UseAuthentication();
|
||||
|
||||
Reference in New Issue
Block a user