1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

feat: add deviceId to response for pending auth requests; Modified queries to match join for new devices; Fixed tests to account for object changes.

This commit is contained in:
Ike Kottlowski
2025-06-14 00:06:09 -04:00
parent d525a1c93c
commit f944bd2a31
9 changed files with 129 additions and 16 deletions

View File

@ -9,9 +9,12 @@ BEGIN
;WITH PendingRequests AS (
SELECT
AR.*,
ROW_NUMBER() OVER (PARTITION BY RequestDeviceIdentifier ORDER BY CreationDate DESC) AS rn
D.Id AS DeviceId,
ROW_NUMBER() OVER (PARTITION BY AR.RequestDeviceIdentifier ORDER BY AR.CreationDate DESC) AS rn
FROM dbo.AuthRequestView AR
WHERE Type IN (0, 1) -- 0 = AuthenticateAndUnlock, 1 = Unlock
LEFT JOIN
Device D ON AR.RequestDeviceIdentifier = D.Identifier
WHERE AR.Type IN (0, 1) -- 0 = AuthenticateAndUnlock, 1 = Unlock
AND AR.CreationDate >= DATEADD(MINUTE, -@ExpirationMinutes, GETUTCDATE())
AND AR.UserId = @UserId
)