mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
[SM-501] Add support for revoking access tokens (#2692)
* Add support for revoking access tokens
This commit is contained in:
23
util/Migrator/DbScripts/2023-02-14_00_RevokeApiKeys.sql
Normal file
23
util/Migrator/DbScripts/2023-02-14_00_RevokeApiKeys.sql
Normal file
@ -0,0 +1,23 @@
|
||||
CREATE OR ALTER PROCEDURE [dbo].[ApiKey_DeleteByIds]
|
||||
@Ids [dbo].[GuidIdArray] READONLY
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
DECLARE @BatchSize INT = 100
|
||||
|
||||
WHILE @BatchSize > 0
|
||||
BEGIN
|
||||
BEGIN TRANSACTION ApiKey_DeleteMany
|
||||
|
||||
DELETE TOP(@BatchSize) AK
|
||||
FROM
|
||||
[dbo].[ApiKey] AK
|
||||
INNER JOIN
|
||||
@Ids I ON I.Id = AK.Id
|
||||
|
||||
SET @BatchSize = @@ROWCOUNT
|
||||
|
||||
COMMIT TRANSACTION ApiKey_DeleteMany
|
||||
END
|
||||
END
|
Reference in New Issue
Block a user