1
0
mirror of https://github.com/bitwarden/server synced 2025-12-20 02:03:46 +00:00

initiating u2f registration

This commit is contained in:
Kyle Spearrin
2017-06-21 22:33:45 -04:00
parent fd5e2c9466
commit 731a1e31b9
12 changed files with 149 additions and 47 deletions

View File

@@ -199,33 +199,6 @@ namespace Bit.Core.Models.Api
{
[Required]
public string DeviceResponse { get; set; }
public User ToUser(User extistingUser)
{
var providers = extistingUser.GetTwoFactorProviders();
if(providers == null)
{
providers = new Dictionary<TwoFactorProviderType, TwoFactorProvider>();
}
else if(providers.ContainsKey(TwoFactorProviderType.U2f))
{
providers.Remove(TwoFactorProviderType.U2f);
}
providers.Add(TwoFactorProviderType.U2f, new TwoFactorProvider
{
MetaData = new Dictionary<string, object>
{
["Key1"] = new TwoFactorProvider.U2fMetaData
{
// TODO
}
},
Enabled = true
});
extistingUser.SetTwoFactorProviders(providers);
return extistingUser;
}
}
public class UpdateTwoFactorEmailRequestModel : TwoFactorEmailRequestModel