Skip to content

Commit f121d1b

Browse files
committed
Add save active session if up-party change form marker session.
1 parent 4213647 commit f121d1b

File tree

11 files changed

+18
-16
lines changed

11 files changed

+18
-16
lines changed

src/FoxIDs.Control/FoxIDs.Control.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>
5-
<Version>2.9.8</Version>
5+
<Version>2.9.9</Version>
66
<RootNamespace>FoxIDs</RootNamespace>
77
<Authors>Anders Revsgaard</Authors>
88
<Company>FoxIDs</Company>

src/FoxIDs.ControlClient/FoxIDs.ControlClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>
5-
<Version>2.9.8</Version>
5+
<Version>2.9.9</Version>
66
<RootNamespace>FoxIDs.Client</RootNamespace>
77
<Authors>Anders Revsgaard</Authors>
88
<Company>FoxIDs</Company>

src/FoxIDs.ControlShared/FoxIDs.ControlShared.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>
5-
<Version>2.9.8</Version>
5+
<Version>2.9.9</Version>
66
<RootNamespace>FoxIDs</RootNamespace>
77
<Authors>Anders Revsgaard</Authors>
88
<Company>FoxIDs</Company>

src/FoxIDs.Shared/FoxIDs.Shared.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>
5-
<Version>2.9.8</Version>
5+
<Version>2.9.9</Version>
66
<RootNamespace>FoxIDs</RootNamespace>
77
<Authors>Anders Revsgaard</Authors>
88
<Company>FoxIDs</Company>

src/FoxIDs.SharedBase/FoxIDs.SharedBase.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>
5-
<Version>2.9.8</Version>
5+
<Version>2.9.9</Version>
66
<RootNamespace>FoxIDs</RootNamespace>
77
<Authors>Anders Revsgaard</Authors>
88
<Company>FoxIDs</Company>

src/FoxIDs/FoxIDs.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
33
<TargetFramework>net9.0</TargetFramework>
4-
<Version>2.9.8</Version>
4+
<Version>2.9.9</Version>
55
<RootNamespace>FoxIDs</RootNamespace>
66
<Authors>Anders Revsgaard</Authors>
77
<Company>FoxIDs</Company>

src/FoxIDs/Logic/ExternalLogin/ExternalLoginPageLogic.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public async Task<IActionResult> LoginResponseUpdateSessionAsync(ExternalLoginUp
9696
{
9797
if (session != null && await sessionLogic.UpdateSessionAsync(extLoginUpParty, session))
9898
{
99-
await sessionLogic.AddOrUpdateSessionTrackAsync(extLoginUpParty, sequenceData.DownPartyLink, updateDbActiveSession: true);
99+
await sessionLogic.AddOrUpdateSessionTrackAsync(extLoginUpParty, sequenceData.DownPartyLink, saveDbActiveSession: true);
100100
(var transformedClaims, var actionResult) = await TransformClaimsAsync(extLoginUpParty, sequenceData, session.Claims.ToClaimList());
101101
if (actionResult != null)
102102
{

src/FoxIDs/Logic/Login/LoginPageLogic.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public async Task<IActionResult> LoginResponseUpdateSessionAsync(LoginUpParty lo
368368
{
369369
if (session != null && await sessionLogic.UpdateSessionAsync(loginUpParty, session))
370370
{
371-
await sessionLogic.AddOrUpdateSessionTrackAsync(loginUpParty, sequenceData.DownPartyLink, updateDbActiveSession: true);
371+
await sessionLogic.AddOrUpdateSessionTrackAsync(loginUpParty, sequenceData.DownPartyLink, saveDbActiveSession: true);
372372
(var transformedClaims, var actionResult) = await TransformClaimsAsync(loginUpParty, sequenceData, session.Claims.ToClaimList());
373373
if (actionResult != null)
374374
{

src/FoxIDs/Logic/Tracks/SessionBaseLogic.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected bool SessionEnabled<T>(T upParty) where T : IUpParty
7676
return upParty.SessionLifetime > 0 || upParty.PersistentSessionAbsoluteLifetime > 0 || upParty.PersistentSessionLifetimeUnlimited;
7777
}
7878

79-
public async Task AddOrUpdateSessionTrackAsync<T>(T upParty, DownPartySessionLink downPartyLink, bool updateDbActiveSession = false) where T : IUpParty
79+
public async Task AddOrUpdateSessionTrackAsync<T>(T upParty, DownPartySessionLink downPartyLink, bool saveDbActiveSession = false) where T : IUpParty
8080
{
8181
(var session, var sessionGroups) = await LoadSessionTrackAsync(upParty, downPartyLink);
8282
foreach (var sessionGroup in sessionGroups)
@@ -89,13 +89,13 @@ public async Task AddOrUpdateSessionTrackAsync<T>(T upParty, DownPartySessionLin
8989
}
9090
await sessionTrackCookieRepository.SaveAsync(session);
9191

92-
if (updateDbActiveSession)
92+
if (saveDbActiveSession)
9393
{
9494
await activeSessionLogic.SaveSessionAsync(sessionGroups, session.CreateTime, session.LastUpdated);
9595
}
9696
}
9797

98-
protected async Task AddOrUpdateSessionTrackWithClaimsAsync<T>(T upParty, IEnumerable<ClaimAndValues> claims, bool updateDbActiveSession = false) where T : IUpParty
98+
protected async Task AddOrUpdateSessionTrackWithClaimsAsync<T>(T upParty, IEnumerable<ClaimAndValues> claims, bool saveDbActiveSession = false) where T : IUpParty
9999
{
100100
(var session, var sessionGroups) = await LoadSessionTrackAsync(upParty, null);
101101
foreach (var sessionGroup in sessionGroups)
@@ -109,7 +109,7 @@ protected async Task AddOrUpdateSessionTrackWithClaimsAsync<T>(T upParty, IEnume
109109
}
110110
await sessionTrackCookieRepository.SaveAsync(session);
111111

112-
if (updateDbActiveSession && claims?.Any() == true)
112+
if (saveDbActiveSession && claims?.Any() == true)
113113
{
114114
await activeSessionLogic.SaveSessionAsync(sessionGroups, session.CreateTime, session.LastUpdated);
115115
}

src/FoxIDs/Logic/Tracks/SessionLoginUpPartyLogic.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public async Task CreateSessionAsync(IUpParty upParty, long authTime, LoginUserI
5151
session.CreateTime = authTime;
5252
session.LastUpdated = authTime;
5353
SetLoginUserIdentifier(session, loginUserIdentifier);
54-
await AddOrUpdateSessionTrackWithClaimsAsync(upParty, session.Claims, updateDbActiveSession: true);
54+
await AddOrUpdateSessionTrackWithClaimsAsync(upParty, session.Claims, saveDbActiveSession: true);
5555
await sessionCookieRepository.SaveAsync(upParty, session, GetPersistentCookieExpires(upParty, session.CreateTime));
5656
logger.ScopeTrace(() => $"Session created, User id '{session.UserIdClaim}', Session id '{session.SessionIdClaim}'.", GetSessionScopeProperties(session));
5757
}
@@ -79,7 +79,7 @@ public async Task<bool> UpdateSessionAsync(IUpParty upParty, SessionLoginUpParty
7979
{
8080
SetLoginUserIdentifier(session, loginUserIdentifier);
8181
}
82-
await AddOrUpdateSessionTrackWithClaimsAsync(upParty, session.Claims, updateDbActiveSession: false);
82+
await AddOrUpdateSessionTrackWithClaimsAsync(upParty, session.Claims);
8383
await sessionCookieRepository.SaveAsync(upParty, session, GetPersistentCookieExpires(upParty, session.CreateTime));
8484
logger.ScopeTrace(() => $"Session updated, Session id '{session.SessionIdClaim}'.", GetSessionScopeProperties(session));
8585
return true;

0 commit comments

Comments
 (0)