mirror of
https://github.com/bitwarden/mobile
synced 2025-12-10 05:13:31 +00:00
[PM-3342] Not you button logs user out. (#2672)
This commit is contained in:
@@ -66,7 +66,7 @@
|
|||||||
TextColor="{DynamicResource HyperlinkColor}"
|
TextColor="{DynamicResource HyperlinkColor}"
|
||||||
AutomationId="NotYouLabel">
|
AutomationId="NotYouLabel">
|
||||||
<Label.GestureRecognizers>
|
<Label.GestureRecognizers>
|
||||||
<TapGestureRecognizer Tapped="Cancel_Clicked" />
|
<TapGestureRecognizer Command="{Binding LogoutCommand}" />
|
||||||
</Label.GestureRecognizers>
|
</Label.GestureRecognizers>
|
||||||
</Label>
|
</Label>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ namespace Bit.App.Pages
|
|||||||
_vm.LogInWithDeviceAction = () => StartLoginWithDeviceAsync().FireAndForget();
|
_vm.LogInWithDeviceAction = () => StartLoginWithDeviceAsync().FireAndForget();
|
||||||
_vm.RequestAdminApprovalAction = () => RequestAdminApprovalAsync().FireAndForget();
|
_vm.RequestAdminApprovalAction = () => RequestAdminApprovalAsync().FireAndForget();
|
||||||
_vm.ContinueToVaultAction = () => ContinueToVaultAsync().FireAndForget();
|
_vm.ContinueToVaultAction = () => ContinueToVaultAsync().FireAndForget();
|
||||||
_vm.CloseAction = () => { Navigation.PopModalAsync(); };
|
|
||||||
_vm.Page = this;
|
_vm.Page = this;
|
||||||
_appOptions = appOptions;
|
_appOptions = appOptions;
|
||||||
}
|
}
|
||||||
@@ -33,14 +32,6 @@ namespace Bit.App.Pages
|
|||||||
_vm.InitAsync();
|
_vm.InitAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Cancel_Clicked(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (DoOnce())
|
|
||||||
{
|
|
||||||
_vm.CloseAction();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task ContinueToVaultAsync()
|
private async Task ContinueToVaultAsync()
|
||||||
{
|
{
|
||||||
if (AppHelpers.SetAlternateMainPage(_appOptions))
|
if (AppHelpers.SetAlternateMainPage(_appOptions))
|
||||||
|
|||||||
@@ -29,17 +29,18 @@ namespace Bit.App.Pages
|
|||||||
private IDeviceTrustCryptoService _deviceTrustCryptoService;
|
private IDeviceTrustCryptoService _deviceTrustCryptoService;
|
||||||
private readonly IAuthService _authService;
|
private readonly IAuthService _authService;
|
||||||
private readonly ISyncService _syncService;
|
private readonly ISyncService _syncService;
|
||||||
|
private readonly IMessagingService _messagingService;
|
||||||
|
|
||||||
public ICommand ApproveWithMyOtherDeviceCommand { get; }
|
public ICommand ApproveWithMyOtherDeviceCommand { get; }
|
||||||
public ICommand RequestAdminApprovalCommand { get; }
|
public ICommand RequestAdminApprovalCommand { get; }
|
||||||
public ICommand ApproveWithMasterPasswordCommand { get; }
|
public ICommand ApproveWithMasterPasswordCommand { get; }
|
||||||
public ICommand ContinueCommand { get; }
|
public ICommand ContinueCommand { get; }
|
||||||
|
public ICommand LogoutCommand { get; }
|
||||||
|
|
||||||
public Action LogInWithMasterPasswordAction { get; set; }
|
public Action LogInWithMasterPasswordAction { get; set; }
|
||||||
public Action LogInWithDeviceAction { get; set; }
|
public Action LogInWithDeviceAction { get; set; }
|
||||||
public Action RequestAdminApprovalAction { get; set; }
|
public Action RequestAdminApprovalAction { get; set; }
|
||||||
public Action ContinueToVaultAction { get; set; }
|
public Action ContinueToVaultAction { get; set; }
|
||||||
public Action CloseAction { get; set; }
|
|
||||||
|
|
||||||
public LoginApproveDeviceViewModel()
|
public LoginApproveDeviceViewModel()
|
||||||
{
|
{
|
||||||
@@ -48,6 +49,7 @@ namespace Bit.App.Pages
|
|||||||
_deviceTrustCryptoService = ServiceContainer.Resolve<IDeviceTrustCryptoService>();
|
_deviceTrustCryptoService = ServiceContainer.Resolve<IDeviceTrustCryptoService>();
|
||||||
_authService = ServiceContainer.Resolve<IAuthService>();
|
_authService = ServiceContainer.Resolve<IAuthService>();
|
||||||
_syncService = ServiceContainer.Resolve<ISyncService>();
|
_syncService = ServiceContainer.Resolve<ISyncService>();
|
||||||
|
_messagingService = ServiceContainer.Resolve<IMessagingService>();
|
||||||
|
|
||||||
PageTitle = AppResources.LogInInitiated;
|
PageTitle = AppResources.LogInInitiated;
|
||||||
RememberThisDevice = true;
|
RememberThisDevice = true;
|
||||||
@@ -67,6 +69,8 @@ namespace Bit.App.Pages
|
|||||||
ContinueCommand = new AsyncCommand(CreateNewSsoUserAsync,
|
ContinueCommand = new AsyncCommand(CreateNewSsoUserAsync,
|
||||||
onException: ex => HandleException(ex),
|
onException: ex => HandleException(ex),
|
||||||
allowsMultipleExecutions: false);
|
allowsMultipleExecutions: false);
|
||||||
|
|
||||||
|
LogoutCommand = new Command(() => _messagingService.Send(AccountsManagerMessageCommands.LOGOUT));
|
||||||
}
|
}
|
||||||
|
|
||||||
public string LoggingInAsText => string.Format(AppResources.LoggingInAsX, Email);
|
public string LoggingInAsText => string.Format(AppResources.LoggingInAsX, Email);
|
||||||
|
|||||||
@@ -634,7 +634,6 @@ namespace Bit.iOS.Autofill
|
|||||||
vm.LogInWithMasterPasswordAction = () => DismissViewController(false, () => PerformSegue("lockPasswordSegue", this));
|
vm.LogInWithMasterPasswordAction = () => DismissViewController(false, () => PerformSegue("lockPasswordSegue", this));
|
||||||
vm.RequestAdminApprovalAction = () => DismissViewController(false, () => LaunchLoginWithDevice(AuthRequestType.AdminApproval, vm.Email));
|
vm.RequestAdminApprovalAction = () => DismissViewController(false, () => LaunchLoginWithDevice(AuthRequestType.AdminApproval, vm.Email));
|
||||||
vm.LogInWithDeviceAction = () => DismissViewController(false, () => LaunchLoginWithDevice(AuthRequestType.AuthenticateAndUnlock, vm.Email));
|
vm.LogInWithDeviceAction = () => DismissViewController(false, () => LaunchLoginWithDevice(AuthRequestType.AuthenticateAndUnlock, vm.Email));
|
||||||
vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var navigationPage = new NavigationPage(loginApproveDevicePage);
|
var navigationPage = new NavigationPage(loginApproveDevicePage);
|
||||||
|
|||||||
@@ -656,7 +656,6 @@ namespace Bit.iOS.Extension
|
|||||||
vm.LogInWithMasterPasswordAction = () => DismissViewController(false, () => PerformSegue("lockPasswordSegue", this));
|
vm.LogInWithMasterPasswordAction = () => DismissViewController(false, () => PerformSegue("lockPasswordSegue", this));
|
||||||
vm.RequestAdminApprovalAction = () => DismissViewController(false, () => LaunchLoginWithDevice(AuthRequestType.AdminApproval, vm.Email));
|
vm.RequestAdminApprovalAction = () => DismissViewController(false, () => LaunchLoginWithDevice(AuthRequestType.AdminApproval, vm.Email));
|
||||||
vm.LogInWithDeviceAction = () => DismissViewController(false, () => LaunchLoginWithDevice(AuthRequestType.AuthenticateAndUnlock, vm.Email));
|
vm.LogInWithDeviceAction = () => DismissViewController(false, () => LaunchLoginWithDevice(AuthRequestType.AuthenticateAndUnlock, vm.Email));
|
||||||
vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var navigationPage = new NavigationPage(loginApproveDevicePage);
|
var navigationPage = new NavigationPage(loginApproveDevicePage);
|
||||||
|
|||||||
@@ -440,7 +440,6 @@ namespace Bit.iOS.ShareExtension
|
|||||||
vm.LogInWithMasterPasswordAction = () => DismissViewController(false, () => PerformSegue("lockPasswordSegue", this));
|
vm.LogInWithMasterPasswordAction = () => DismissViewController(false, () => PerformSegue("lockPasswordSegue", this));
|
||||||
vm.RequestAdminApprovalAction = () => DismissViewController(false, () => LaunchLoginWithDevice(AuthRequestType.AdminApproval, vm.Email));
|
vm.RequestAdminApprovalAction = () => DismissViewController(false, () => LaunchLoginWithDevice(AuthRequestType.AdminApproval, vm.Email));
|
||||||
vm.LogInWithDeviceAction = () => DismissViewController(false, () => LaunchLoginWithDevice(AuthRequestType.AuthenticateAndUnlock, vm.Email));
|
vm.LogInWithDeviceAction = () => DismissViewController(false, () => LaunchLoginWithDevice(AuthRequestType.AuthenticateAndUnlock, vm.Email));
|
||||||
vm.CloseAction = () => DismissViewController(false, () => LaunchHomePage());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var navigationPage = new NavigationPage(loginApproveDevicePage);
|
var navigationPage = new NavigationPage(loginApproveDevicePage);
|
||||||
|
|||||||
Reference in New Issue
Block a user