Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhaeger committed Jan 28, 2025
1 parent 0364dd7 commit 030a76b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Altinn.App.Api/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ public async Task<IActionResult> Index(
[FromQuery] bool dontChooseReportee
)
{
// See comments in the configuration of Antiforgery in MvcConfiguration.cs.
var tokens = _antiforgery.GetAndStoreTokens(HttpContext);
if (tokens.RequestToken != null)
{
HttpContext.Response.Cookies.Append(
"XSRF-TOKEN",
tokens.RequestToken,
new CookieOptions
{
HttpOnly = false, // Make this cookie readable by Javascript.
}
);
}

if (await ShouldShowAppView())
{
ViewBag.org = org;
Expand Down

0 comments on commit 030a76b

Please sign in to comment.