mirror of
https://github.com/bitwarden/server.git
synced 2025-07-07 02:52:50 -05:00
Remove stale SsoUser objects from database (#1560)
* Add SsoUser_ReadByUserIdOrganizationId * Automatically reset stale/duplicate Sso links * Fix typo * Check for stale Sso link in existing user flow * Delete any stale user record before provisioning new user * Check for existing db query before creating * PR feedback updates Co-authored-by: Chad Scharf <3904944+cscharf@users.noreply.github.com>
This commit is contained in:
@ -299,6 +299,7 @@
|
||||
<Build Include="dbo\Stored Procedures\User_ReadBySsoUserOrganizationIdExternalId.sql" />
|
||||
<Build Include="dbo\Stored Procedures\SsoUser_Update.sql" />
|
||||
<Build Include="dbo\Stored Procedures\SsoUser_ReadById.sql" />
|
||||
<Build Include="dbo\Stored Procedures\SsoUser_ReadByUserIdOrganizationId.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Cipher_DeleteByIdsOrganizationId.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Cipher_SoftDeleteByIdsOrganizationId.sql" />
|
||||
<Build Include="dbo\Stored Procedures\Organization_ReadByIdentifier.sql" />
|
||||
|
@ -0,0 +1,15 @@
|
||||
CREATE PROCEDURE [dbo].[SsoUser_ReadByUserIdOrganizationId]
|
||||
@UserId UNIQUEIDENTIFIER,
|
||||
@OrganizationId UNIQUEIDENTIFIER
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
[dbo].[SsoUserView]
|
||||
WHERE
|
||||
[UserId] = @UserId
|
||||
AND [OrganizationId] = @OrganizationId
|
||||
END
|
Reference in New Issue
Block a user