fixed theme and language controller not setting no-cache, no-store header

This commit is contained in:
Mia Rose Winter 2024-02-02 17:06:27 +01:00
parent 96d589df54
commit 3960484ce8
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E
2 changed files with 3 additions and 0 deletions

View file

@ -7,6 +7,7 @@ namespace Wave.Controllers;
[Route("/language")]
public class LanguageController : ControllerBase {
[HttpGet("{culture}")]
[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]
public IActionResult SetLanguage(string culture, string returnUrl = "") {
Response.Cookies.Append(
CookieRequestCultureProvider.DefaultCookieName,

View file

@ -6,12 +6,14 @@ namespace Wave.Controllers;
[Route("/theme")]
public class ThemeController : ControllerBase {
[HttpGet("")]
[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]
public IActionResult SetTheme(string returnUrl = "") {
Response.Cookies.Delete(".Wave.Theme");
return LocalRedirect(string.IsNullOrWhiteSpace(returnUrl) ? "/" : returnUrl);
}
[HttpGet("{theme}")]
[ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)]
public IActionResult SetTheme(string? theme, string returnUrl = "") {
if (theme is null) {
Response.Cookies.Delete(".Wave.Theme");