From 67e65e13dc09b015ab4ec43e6a3899babca2d6e6 Mon Sep 17 00:00:00 2001 From: Ivar Nesje Date: Mon, 6 Nov 2023 15:31:54 +0100 Subject: [PATCH] Add [Authorize] attribute on AuthorizationController.GetCurrentParty This means that the code won't crash with missing cookie when the cookie exipires --- src/Altinn.App.Api/Controllers/AuthorizationController.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Altinn.App.Api/Controllers/AuthorizationController.cs b/src/Altinn.App.Api/Controllers/AuthorizationController.cs index 68c58001e..56cdef38d 100644 --- a/src/Altinn.App.Api/Controllers/AuthorizationController.cs +++ b/src/Altinn.App.Api/Controllers/AuthorizationController.cs @@ -37,6 +37,7 @@ public AuthorizationController( /// Gets current party by reading cookie value and validating. /// /// Party id for selected party. If invalid, partyId for logged in user is returned. + [Authorize] [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] [HttpGet("{org}/{app}/api/authorization/parties/current")] public async Task GetCurrentParty(bool returnPartyObject = false)