mirror of
https://github.com/bitwarden/server
synced 2025-12-06 00:03:34 +00:00
[PM-26632] - Adding Idempotent Confirm User (#6459)
* Added repo call for idempotent user confirm. PLUS TESTS! * Code review changes
This commit is contained in:
28
util/Migrator/DbScripts/2025-10-15_00_OrgUserConfirmById.sql
Normal file
28
util/Migrator/DbScripts/2025-10-15_00_OrgUserConfirmById.sql
Normal file
@@ -0,0 +1,28 @@
|
||||
CREATE OR ALTER PROCEDURE [dbo].[OrganizationUser_ConfirmById]
|
||||
@Id UNIQUEIDENTIFIER,
|
||||
@UserId UNIQUEIDENTIFIER,
|
||||
@RevisionDate DATETIME2(7)
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
DECLARE @RowCount INT;
|
||||
|
||||
UPDATE
|
||||
[dbo].[OrganizationUser]
|
||||
SET
|
||||
[Status] = 2, -- Set to Confirmed
|
||||
[RevisionDate] = @RevisionDate
|
||||
WHERE
|
||||
[Id] = @Id
|
||||
AND [Status] = 1 -- Only update if status is Accepted
|
||||
|
||||
SET @RowCount = @@ROWCOUNT;
|
||||
|
||||
IF @RowCount > 0
|
||||
BEGIN
|
||||
EXEC [dbo].[User_BumpAccountRevisionDate] @UserId
|
||||
END
|
||||
|
||||
SELECT @RowCount;
|
||||
END
|
||||
Reference in New Issue
Block a user