mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
Fix: update queries to only return the most recent authrequest, or none at all if the most recent is approved.
This commit is contained in:
@ -11,12 +11,12 @@ BEGIN
|
||||
AR.*,
|
||||
ROW_NUMBER() OVER (PARTITION BY RequestDeviceIdentifier ORDER BY CreationDate DESC) AS rn
|
||||
FROM dbo.AuthRequestView AR
|
||||
WHERE Type IN (0, 1)
|
||||
WHERE Type IN (0, 1) -- 0 = UnlockAndAUth, 1 = unlock
|
||||
AND AR.CreationDate >= DATEADD(MINUTE, -@ExpirationMinutes, GETUTCDATE())
|
||||
AND AR.UserId = @UserId
|
||||
AND AR.Approved IS NULL
|
||||
)
|
||||
SELECT PR.*
|
||||
FROM PendingRequests PR
|
||||
WHERE rn = 1;
|
||||
WHERE rn = 1
|
||||
AND PR.Approved IS NULL;
|
||||
END;
|
||||
|
Reference in New Issue
Block a user