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:
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user