mirror of
https://github.com/bitwarden/server.git
synced 2025-05-21 03:24:31 -05:00
Clear device keys on deactivate
This commit is contained in:
parent
f90bcd44de
commit
e7644aec38
@ -77,6 +77,9 @@ public class DeviceService : IDeviceService
|
|||||||
|
|
||||||
device.Active = false;
|
device.Active = false;
|
||||||
device.RevisionDate = DateTime.UtcNow;
|
device.RevisionDate = DateTime.UtcNow;
|
||||||
|
device.EncryptedPrivateKey = null;
|
||||||
|
device.EncryptedPublicKey = null;
|
||||||
|
device.EncryptedUserKey = null;
|
||||||
await _deviceRepository.UpsertAsync(device);
|
await _deviceRepository.UpsertAsync(device);
|
||||||
|
|
||||||
await _pushRegistrationService.DeleteRegistrationAsync(device.Id.ToString());
|
await _pushRegistrationService.DeleteRegistrationAsync(device.Id.ToString());
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
UPDATE [dbo].[Device]
|
||||||
|
SET
|
||||||
|
EncryptedUserKey = NULL,
|
||||||
|
EncryptedPublicKey = NULL,
|
||||||
|
EncryptedPrivateKey = NULL
|
||||||
|
WHERE Active = 1
|
||||||
|
AND (
|
||||||
|
EncryptedUserKey IS NOT NULL OR
|
||||||
|
EncryptedPublicKey IS NOT NULL OR
|
||||||
|
EncryptedPrivateKey IS NOT NULL
|
||||||
|
);
|
||||||
|
GO;
|
Loading…
x
Reference in New Issue
Block a user