1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

[PM-3570] Adjust refresh token lifetimes (#3697)

* adjust refresh token lifetimes

* fix broken grant delete

* Update ApiClient.cs

---------

Co-authored-by: Matt Bishop <mbishop@bitwarden.com>
This commit is contained in:
Kyle Spearrin
2024-02-08 16:36:15 -05:00
committed by GitHub
parent 9ecc4794fe
commit 707347ce3e
2 changed files with 8 additions and 15 deletions

View File

@ -19,11 +19,7 @@ public class GrantRepository : BaseEntityFrameworkRepository, IGrantRepository
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();
}
}
@ -32,14 +28,11 @@ public class GrantRepository : BaseEntityFrameworkRepository, IGrantRepository
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();
}
}