Browse Source
* 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>pull/1573/head
8 changed files with 87 additions and 5 deletions
@ -1,11 +1,12 @@
@@ -1,11 +1,12 @@
|
||||
using Bit.Core.Models.Table; |
||||
using System; |
||||
using System.Threading.Tasks; |
||||
using Bit.Core.Models.Table; |
||||
using System; |
||||
using System.Threading.Tasks; |
||||
|
||||
namespace Bit.Core.Repositories |
||||
{ |
||||
public interface ISsoUserRepository : IRepository<SsoUser, long> |
||||
{ |
||||
Task DeleteAsync(Guid userId, Guid? organizationId); |
||||
Task<SsoUser> GetByUserIdOrganizationIdAsync(Guid organizationId, Guid userId); |
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,15 @@
@@ -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 |
||||
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
IF OBJECT_ID('[dbo].[SsoUser_ReadByUserIdOrganizationId]') IS NOT NULL |
||||
BEGIN |
||||
DROP PROCEDURE [dbo].[SsoUser_ReadByUserIdOrganizationId] |
||||
END |
||||
GO |
||||
|
||||
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 |
||||
Loading…
Reference in new issue