Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-3570] Adjust refresh token lifetimes #3697

Merged
merged 6 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Identity/IdentityServer/StaticClientStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public StaticClientStore(GlobalSettings globalSettings)
{
ApiClients = new List<Client>
{
new ApiClient(globalSettings, BitwardenClient.Mobile, 90, 1),
new ApiClient(globalSettings, BitwardenClient.Web, 30, 1),
new ApiClient(globalSettings, BitwardenClient.Mobile, 60, 1),
new ApiClient(globalSettings, BitwardenClient.Web, 7, 1),
new ApiClient(globalSettings, BitwardenClient.Browser, 30, 1),
new ApiClient(globalSettings, BitwardenClient.Desktop, 30, 1),
new ApiClient(globalSettings, BitwardenClient.Cli, 30, 1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ public async Task DeleteByKeyAsync(string key)
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var query = from g in dbContext.Grants
where g.Key == key
select g;
dbContext.Remove(query);
await dbContext.SaveChangesAsync();
await dbContext.Grants.Where(g => g.Key == key).ExecuteDeleteAsync();
}
}

Expand All @@ -32,14 +28,11 @@ public async Task DeleteManyAsync(string subjectId, string sessionId, string cli
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var query = from g in dbContext.Grants
where g.SubjectId == subjectId &&
g.ClientId == clientId &&
g.SessionId == sessionId &&
g.Type == type
select g;
dbContext.Remove(query);
await dbContext.SaveChangesAsync();
await dbContext.Grants.Where(g =>
g.SubjectId == subjectId &&
g.ClientId == clientId &&
g.SessionId == sessionId &&
g.Type == type).ExecuteDeleteAsync();
}
}

Expand Down
Loading