Skip to content

Commit

Permalink
Update naming for selected partyh
Browse files Browse the repository at this point in the history
  • Loading branch information
martinothamar committed Jan 8, 2025
1 parent 54d92f6 commit c7e1fe9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Altinn.App.Api/Controllers/AuthorizationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public async Task<ActionResult> GetCurrentParty(bool returnPartyObject = false)
// Now we know the user can't represent the selected party (reportee)
// so we will automatically switch to the user's own party (from the profile)
var reportee = details.Profile.Party;
if (user.CookiePartyId is null || user.CookiePartyId.Value != reportee.PartyId)
if (user.SelectedPartyId is null || user.SelectedPartyId.Value != reportee.PartyId)
{
// Setting cookie to partyID of logged in user if it varies from previus value.
Response.Cookies.Append(
Expand Down
8 changes: 4 additions & 4 deletions src/Altinn.App.Core/Internal/Auth/IAuthenticationContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public sealed record User : AuthenticationInfo
public int PartyId { get; }

/// <summary>
/// Party ID from party ID selection cookie
/// The party the user has selected through party selection
/// </summary>
public int? CookiePartyId { get; }
public int? SelectedPartyId { get; }

/// <summary>
/// Authentication level
Expand All @@ -82,7 +82,7 @@ internal User(
int userId,
int partyId,
int authenticationLevel,
int? cookiePartyId,
int? selectedPartyId,
string token,
Func<int, Task<UserProfile?>> getUserProfile,
Func<int, Task<Party?>> lookupParty,
Expand All @@ -95,7 +95,7 @@ Func<Task<ApplicationMetadata>> getApplicationMetadata
{
UserId = userId;
PartyId = partyId;
CookiePartyId = cookiePartyId;
SelectedPartyId = selectedPartyId;
AuthenticationLevel = authenticationLevel;
_getUserProfile = getUserProfile;
_lookupParty = lookupParty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ public async Task PostNewInstance_Simplified(TestJwtToken token)
string app = "permissive-app";
int instanceOwnerPartyId = token.PartyId;
using HttpClient client = GetRootedClient(org, app);
// string token = TestAuthentication.GetUserToken(userId: 1337, partyId: instanceOwnerPartyId);

var createResponseParsed = await CreateInstanceSimplified(org, app, instanceOwnerPartyId, client, token.Token);
var instanceId = createResponseParsed.Id;
Expand Down

0 comments on commit c7e1fe9

Please sign in to comment.