1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-21 11:25:56 +01:00

workaround for sliding elements in duo 2fa flow

This commit is contained in:
mpbw2 2024-01-29 13:03:48 -05:00
parent 5f43681fb1
commit dd3d036756
No known key found for this signature in database
2 changed files with 16 additions and 2 deletions

View File

@ -133,12 +133,12 @@
</StackLayout> </StackLayout>
</StackLayout> </StackLayout>
<StackLayout Spacing="0" Padding="0" IsVisible="{Binding DuoMethod, Mode=OneWay}" <StackLayout Spacing="0" Padding="0" IsVisible="{Binding DuoMethod, Mode=OneWay}"
VerticalOptions="FillAndExpand"> VerticalOptions="StartAndExpand">
<controls:HybridWebView <controls:HybridWebView
x:Name="_duoWebView" x:Name="_duoWebView"
HorizontalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
MinimumHeightRequest="400" /> HeightRequest="{Binding DuoWebViewHeight, Mode=OneWay}" />
<StackLayout StyleClass="box" VerticalOptions="End"> <StackLayout StyleClass="box" VerticalOptions="End">
<StackLayout StyleClass="box-row, box-row-switch"> <StackLayout StyleClass="box-row, box-row-switch">
<Label <Label

View File

@ -34,6 +34,7 @@ namespace Bit.App.Pages
private string _webVaultUrl = "https://vault.bitwarden.com"; private string _webVaultUrl = "https://vault.bitwarden.com";
private bool _enableContinue = false; private bool _enableContinue = false;
private bool _showContinue = true; private bool _showContinue = true;
private double _duoWebViewHeight;
public TwoFactorPageViewModel() public TwoFactorPageViewModel()
{ {
@ -63,6 +64,12 @@ namespace Bit.App.Pages
set => SetProperty(ref _totpInstruction, value); set => SetProperty(ref _totpInstruction, value);
} }
public double DuoWebViewHeight
{
get => _duoWebViewHeight;
set => SetProperty(ref _duoWebViewHeight, value);
}
public bool Remember { get; set; } public bool Remember { get; set; }
public bool AuthingWithSso { get; set; } public bool AuthingWithSso { get; set; }
@ -172,6 +179,7 @@ namespace Bit.App.Pages
break; break;
case TwoFactorProviderType.Duo: case TwoFactorProviderType.Duo:
case TwoFactorProviderType.OrganizationDuo: case TwoFactorProviderType.OrganizationDuo:
SetDuoWebViewHeight();
var host = WebUtility.UrlEncode(providerData["Host"] as string); var host = WebUtility.UrlEncode(providerData["Host"] as string);
var req = WebUtility.UrlEncode(providerData["Signature"] as string); var req = WebUtility.UrlEncode(providerData["Signature"] as string);
page.DuoWebView.Uri = $"{_webVaultUrl}/duo-connector.html?host={host}&request={req}"; page.DuoWebView.Uri = $"{_webVaultUrl}/duo-connector.html?host={host}&request={req}";
@ -203,6 +211,12 @@ namespace Bit.App.Pages
ShowContinue = !(SelectedProviderType == null || DuoMethod || Fido2Method); ShowContinue = !(SelectedProviderType == null || DuoMethod || Fido2Method);
} }
public void SetDuoWebViewHeight()
{
var screenHeight = DeviceDisplay.MainDisplayInfo.Height / DeviceDisplay.MainDisplayInfo.Density;
DuoWebViewHeight = screenHeight > 0 ? (screenHeight / 8) * 6 : 400;
}
public async Task Fido2AuthenticateAsync(Dictionary<string, object> providerData = null) public async Task Fido2AuthenticateAsync(Dictionary<string, object> providerData = null)
{ {
try try