mirror of
https://github.com/bitwarden/server.git
synced 2025-07-18 08:00:59 -05:00
[SM-501] Add support for revoking access tokens (#2692)
* Add support for revoking access tokens
This commit is contained in:
@ -36,4 +36,13 @@ public class ApiKeyRepository : Repository<Core.SecretsManager.Entities.ApiKey,
|
||||
|
||||
return Mapper.Map<List<Core.SecretsManager.Entities.ApiKey>>(apiKeys);
|
||||
}
|
||||
|
||||
public async Task DeleteManyAsync(IEnumerable<Core.SecretsManager.Entities.ApiKey> objs)
|
||||
{
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var dbContext = GetDatabaseContext(scope);
|
||||
var entities = objs.Select(obj => Mapper.Map<ApiKey>(obj));
|
||||
dbContext.RemoveRange(entities);
|
||||
await dbContext.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user