1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

return twofactor enabled property on org users api

This commit is contained in:
Kyle Spearrin
2018-12-19 11:48:36 -05:00
parent 866cfefd80
commit 4a38713c4b
10 changed files with 117 additions and 16 deletions

View File

@ -6,11 +6,10 @@ using Newtonsoft.Json;
using Bit.Core.Services;
using Bit.Core.Exceptions;
using Microsoft.AspNetCore.Identity;
using System.Threading.Tasks;
namespace Bit.Core.Models.Table
{
public class User : ITableObject<Guid>, ISubscriber, IStorable, IStorableSubscriber, IRevisable
public class User : ITableObject<Guid>, ISubscriber, IStorable, IStorableSubscriber, IRevisable, ITwoFactorProvidersUser
{
private Dictionary<TwoFactorProviderType, TwoFactorProvider> _twoFactorProviders;
@ -83,6 +82,16 @@ namespace Bit.Core.Models.Table
}
}
public Guid? GetUserId()
{
return Id;
}
public bool GetPremium()
{
return Premium;
}
public void SetTwoFactorProviders(Dictionary<TwoFactorProviderType, TwoFactorProvider> providers)
{
TwoFactorProviders = JsonConvert.SerializeObject(providers, new JsonSerializerSettings