mirror of
https://github.com/bitwarden/mobile
synced 2025-12-23 11:43:49 +00:00
Added equivalent domain checks to autofill listing filter. centralized logic in login service.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
using Bit.App.Abstractions;
|
||||
using Plugin.Settings.Abstractions;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Bit.App.Services
|
||||
{
|
||||
@@ -7,13 +10,27 @@ namespace Bit.App.Services
|
||||
{
|
||||
private readonly ISettingsRepository _settingsRepository;
|
||||
private readonly ISettings _settings;
|
||||
private readonly IAuthService _authService;
|
||||
|
||||
public SettingsService(
|
||||
ISettingsRepository settingsRepository,
|
||||
ISettings settings)
|
||||
ISettings settings,
|
||||
IAuthService authService)
|
||||
{
|
||||
_settingsRepository = settingsRepository;
|
||||
_settings = settings;
|
||||
_authService = authService;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<IEnumerable<string>>> GetEquivalentDomainsAsync()
|
||||
{
|
||||
var settings = await _settingsRepository.GetByIdAsync(_authService.UserId);
|
||||
if(string.IsNullOrWhiteSpace(settings?.EquivalentDomains))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return JsonConvert.DeserializeObject<IEnumerable<IEnumerable<string>>>(settings.EquivalentDomains);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user