1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-13 06:43:17 +00:00

cleanup and updated resource strings for autofill

This commit is contained in:
Kyle Spearrin
2018-09-21 15:32:12 -04:00
parent e613198252
commit fce2a7ba94
10 changed files with 82 additions and 59 deletions

View File

@@ -55,15 +55,8 @@ namespace Bit.iOS.Autofill
{
_context.ServiceIdentifiers = serviceIdentifiers;
_context.UrlString = serviceIdentifiers[0].Identifier;
var authService = Resolver.Resolve<IAuthService>();
if(!authService.IsAuthenticated)
if(!CheckAuthed())
{
var alert = Dialogs.CreateAlert(null, AppResources.MustLogInMainApp, AppResources.Ok, (a) =>
{
CompleteRequest();
});
PresentViewController(alert, true, null);
return;
}
@@ -110,37 +103,21 @@ namespace Bit.iOS.Autofill
public override void PrepareInterfaceToProvideCredential(ASPasswordCredentialIdentity credentialIdentity)
{
var authService = Resolver.Resolve<IAuthService>();
if(!authService.IsAuthenticated)
if(!CheckAuthed())
{
var alert = Dialogs.CreateAlert(null, AppResources.MustLogInMainApp, AppResources.Ok, (a) =>
{
CompleteRequest();
});
PresentViewController(alert, true, null);
return;
}
_context.CredentialIdentity = credentialIdentity;
CheckLock(() => ProvideCredential());
}
public override void PrepareInterfaceForExtensionConfiguration()
{
System.Diagnostics.Debug.WriteLine("AUTOFILL BITWARDEN: PrepareInterfaceForExtensionConfiguration");
_context.Configuring = true;
var authService = Resolver.Resolve<IAuthService>();
if(!authService.IsAuthenticated)
if(!CheckAuthed())
{
var alert = Dialogs.CreateAlert(null, AppResources.MustLogInMainApp, AppResources.Ok, (a) =>
{
CompleteRequest();
});
PresentViewController(alert, true, null);
return;
}
CheckLock(() => PerformSegue("setupSegue", this));
}
@@ -274,6 +251,21 @@ namespace Bit.iOS.Autofill
}
}
private bool CheckAuthed()
{
var authService = Resolver.Resolve<IAuthService>();
if(!authService.IsAuthenticated)
{
var alert = Dialogs.CreateAlert(null, AppResources.MustLogInMainAppAutofill, AppResources.Ok, (a) =>
{
CompleteRequest();
});
PresentViewController(alert, true, null);
return false;
}
return true;
}
private void SetIoc()
{
var container = new Container();