mirror of
https://github.com/bitwarden/server
synced 2026-01-15 06:53:26 +00:00
* Sso user table, model and repo stubbed out * switch to nullable org id, bigint id * update GetBySsoUserAsync * cleanup migrator file * fix EF user repo * fix pg repo * is `IS NULL` checks * unique indexes * update migration scripts * add another unique index * remove old script
20 lines
524 B
Transact-SQL
20 lines
524 B
Transact-SQL
CREATE PROCEDURE [dbo].[User_ReadBySsoUserOrganizationIdExternalId]
|
|
@OrganizationId UNIQUEIDENTIFIER,
|
|
@ExternalId NVARCHAR(50)
|
|
AS
|
|
BEGIN
|
|
SET NOCOUNT ON
|
|
|
|
SELECT
|
|
U.*
|
|
FROM
|
|
[dbo].[UserView] U
|
|
INNER JOIN
|
|
[dbo].[SsoUser] SU ON SU.[UserId] = U.[Id]
|
|
WHERE
|
|
(
|
|
(@OrganizationId IS NULL AND SU.[OrganizationId] IS NULL)
|
|
OR (@OrganizationId IS NOT NULL AND SU.[OrganizationId] = @OrganizationId)
|
|
)
|
|
AND SU.[ExternalId] = @ExternalId
|
|
END |