1
0
mirror of https://github.com/bitwarden/server synced 2025-12-06 00:03:34 +00:00

[PM-25390] CORS - Password Change URI (#6287)

* enable cors headers for icons program
- This is needed now that browsers can hit the change-password-uri path via API call

* Add absolute route for change-password-uri
This commit is contained in:
Nick Krantz
2025-09-05 10:59:36 -05:00
committed by GitHub
parent 87bc9299e6
commit 353b596a6d
2 changed files with 4 additions and 1 deletions

View File

@@ -5,7 +5,7 @@ using Microsoft.Extensions.Caching.Memory;
namespace Bit.Icons.Controllers; namespace Bit.Icons.Controllers;
[Route("change-password-uri")] [Route("~/change-password-uri")]
public class ChangePasswordUriController : Controller public class ChangePasswordUriController : Controller
{ {
private readonly IMemoryCache _memoryCache; private readonly IMemoryCache _memoryCache;

View File

@@ -92,6 +92,9 @@ public class Startup
await next(); await next();
}); });
app.UseCors(policy => policy.SetIsOriginAllowed(o => CoreHelpers.IsCorsOriginAllowed(o, globalSettings))
.AllowAnyMethod().AllowAnyHeader().AllowCredentials());
app.UseRouting(); app.UseRouting();
app.UseEndpoints(endpoints => endpoints.MapDefaultControllerRoute()); app.UseEndpoints(endpoints => endpoints.MapDefaultControllerRoute());
} }