1
0
mirror of https://github.com/bitwarden/server synced 2025-12-30 07:03:42 +00: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

@@ -30,6 +30,23 @@ namespace Bit.Core.Repositories.SqlServer
return device;
}
public async Task<Device> GetByIdentifierAsync(string identifier, Guid userId)
{
using(var connection = new SqlConnection(ConnectionString))
{
var results = await connection.QueryAsync<Device>(
$"[{Schema}].[{Table}_ReadByIdentifierUserId]",
new
{
UserId = userId,
Identifier = identifier
},
commandType: CommandType.StoredProcedure);
return results.FirstOrDefault();
}
}
public async Task<ICollection<Device>> GetManyByUserIdAsync(Guid userId)
{
using(var connection = new SqlConnection(ConnectionString))