1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 09:32:48 -05:00

u2f db updates

This commit is contained in:
Kyle Spearrin
2018-07-21 08:44:21 -04:00
parent f7fb99a726
commit 941792bdd8
6 changed files with 83 additions and 3 deletions

View File

@ -281,13 +281,14 @@ namespace Bit.Core.Services
public async Task<U2fRegistration> StartU2fRegistrationAsync(User user)
{
await _u2fRepository.DeleteManyByUserIdAsync(user.Id);
var reg = U2fLib.StartRegistration(Utilities.CoreHelpers.U2fAppIdUrl(_globalSettings));
var reg = U2fLib.StartRegistration(CoreHelpers.U2fAppIdUrl(_globalSettings));
await _u2fRepository.CreateAsync(new U2f
{
AppId = reg.AppId,
Challenge = reg.Challenge,
Version = reg.Version,
UserId = user.Id
UserId = user.Id,
CreationDate = DateTime.UtcNow
});
return new U2fRegistration