better handle service identifiers

This commit is contained in:
kspearrin 2018-09-21 22:27:20 -04:00
parent 3fff0617fe
commit f9028245d8
2 changed files with 15 additions and 2 deletions

View File

@ -54,7 +54,15 @@ namespace Bit.iOS.Autofill
public override void PrepareCredentialList(ASCredentialServiceIdentifier[] serviceIdentifiers) public override void PrepareCredentialList(ASCredentialServiceIdentifier[] serviceIdentifiers)
{ {
_context.ServiceIdentifiers = serviceIdentifiers; _context.ServiceIdentifiers = serviceIdentifiers;
_context.UrlString = serviceIdentifiers[0].Identifier; if(serviceIdentifiers.Length > 0)
{
var uri = serviceIdentifiers[0].Identifier;
if(serviceIdentifiers[0].Type == ASCredentialServiceIdentifierType.Domain)
{
uri = string.Concat("https://", uri);
}
_context.UrlString = uri;
}
if(!CheckAuthed()) if(!CheckAuthed())
{ {
return; return;

View File

@ -28,7 +28,12 @@ namespace Bit.iOS.Core.Models
set set
{ {
_uriString = value; _uriString = value;
if(_uriString != null && !_uriString.StartsWith(App.Constants.iOSAppProtocol) && _uriString.Contains(".")) if(string.IsNullOrWhiteSpace(_uriString))
{
return;
}
if(!_uriString.StartsWith(App.Constants.iOSAppProtocol) && _uriString.Contains("."))
{ {
if(!_uriString.Contains("://") && !_uriString.Contains(" ")) if(!_uriString.Contains("://") && !_uriString.Contains(" "))
{ {