1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-27 03:41:30 +01:00

Bump revision dates

This commit is contained in:
Thomas Avery 2024-10-16 14:29:12 -05:00
parent 2cb60452e8
commit 8a1c761d8b
No known key found for this signature in database
GPG Key ID: 44A02A0410B0F429
3 changed files with 11 additions and 2 deletions

View File

@ -23,8 +23,11 @@ public class UserAsymmetricKeysRepository : BaseEntityFrameworkRepository, IUser
var entity = await dbContext.Users.FindAsync(userAsymmetricKeys.UserId);
if (entity != null)
{
var utcNow = DateTime.UtcNow;
entity.PublicKey = userAsymmetricKeys.PublicKey;
entity.PrivateKey = userAsymmetricKeys.UserKeyEncryptedPrivateKey;
entity.RevisionDate = utcNow;
entity.AccountRevisionDate = utcNow;
await dbContext.SaveChangesAsync();
}
}

View File

@ -5,9 +5,12 @@ CREATE PROCEDURE [dbo].[UserAsymmetricKeys_Regenerate]
AS
BEGIN
SET NOCOUNT ON
DECLARE @UtcNow DATETIME2(7) = GETUTCDATE();
UPDATE [dbo].[User]
SET [PublicKey] = @PublicKey,
[PrivateKey] = @PrivateKey
[PrivateKey] = @PrivateKey,
[RevisionDate] = @UtcNow,
[AccountRevisionDate] = @UtcNow
WHERE [Id] = @UserId
END

View File

@ -5,9 +5,12 @@ CREATE OR ALTER PROCEDURE [dbo].[UserAsymmetricKeys_Regenerate]
AS
BEGIN
SET NOCOUNT ON
DECLARE @UtcNow DATETIME2(7) = GETUTCDATE();
UPDATE [dbo].[User]
SET [PublicKey] = @PublicKey,
[PrivateKey] = @PrivateKey
[PrivateKey] = @PrivateKey,
[RevisionDate] = @UtcNow,
[AccountRevisionDate] = @UtcNow
WHERE [Id] = @UserId
END