mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 05:00:19 -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:
parent
9ecc4794fe
commit
707347ce3e
@ -10,8 +10,8 @@ public class StaticClientStore
|
||||
{
|
||||
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),
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user