1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-22 19:23:58 +00:00

Added equivalent domain checks to autofill listing filter. centralized logic in login service.

This commit is contained in:
Kyle Spearrin
2017-02-08 23:58:37 -05:00
parent 2a1bd92e1a
commit 539121070a
8 changed files with 114 additions and 69 deletions

View File

@@ -26,37 +26,6 @@ namespace Bit.App.Models.Page
public string Username { get; set; }
public Lazy<string> Password { get; set; }
public Lazy<string> Uri { get; set; }
public string BaseDomain
{
get
{
if(_baseDomain != null)
{
return _baseDomain;
}
if(string.IsNullOrWhiteSpace(Uri.Value))
{
return null;
}
Uri uri;
if(!System.Uri.TryCreate(Uri.Value, UriKind.Absolute, out uri))
{
return null;
}
DomainName domain;
if(!DomainName.TryParse(uri.Host, out domain))
{
return null;
}
_baseDomain = domain.BaseDomain;
return _baseDomain;
}
}
}
public class Folder : List<Login>