1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 16:42:50 -05:00

Added device identifier, APIs for updating token by identifier, Device creation/update upon signin.

This commit is contained in:
Kyle Spearrin
2016-06-21 00:08:22 -04:00
parent 8a34692e7c
commit 37ec1de7a3
12 changed files with 109 additions and 6 deletions

View File

@ -90,6 +90,7 @@
<Build Include="dbo\Stored Procedures\Device_ReadById.sql" />
<Build Include="dbo\Stored Procedures\Device_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\Device_DeleteById.sql" />
<Build Include="dbo\Stored Procedures\Device_ReadByIdentifierUserId.sql" />
<Build Include="dbo\Stored Procedures\Cipher_ReadByUserId.sql" />
<Build Include="dbo\Stored Procedures\User_UpdateEmailPassword.sql" />
</ItemGroup>

View File

@ -0,0 +1,15 @@
CREATE PROCEDURE [dbo].[Device_ReadByIdentifierUserId]
@UserId UNIQUEIDENTIFIER,
@Identifier NVARCHAR(50)
AS
BEGIN
SET NOCOUNT ON
SELECT
*
FROM
[dbo].[DeviceView]
WHERE
[UserId] = @UserId
AND [Identifier] = @Identifier
END

View File

@ -3,6 +3,7 @@
[UserId] UNIQUEIDENTIFIER NOT NULL,
[Name] NVARCHAR (50) NOT NULL,
[Type] SMALLINT NOT NULL,
[Identifier] NVARCHAR (50) NOT NULL,
[PushToken] NVARCHAR (255) NULL,
[CreationDate] DATETIME2 (7) NOT NULL,
[RevisionDate] DATETIME2 (7) NOT NULL,
@ -15,3 +16,8 @@ GO
CREATE NONCLUSTERED INDEX [IX_Device_UserId]
ON [dbo].[Device]([UserId] ASC);
GO
CREATE UNIQUE NONCLUSTERED INDEX [UX_Device_UserId_Identifier]
ON [dbo].[Device]([UserId] ASC, [Identifier] ASC);