diff --git a/src/App/Pages/Accounts/LoginPage.xaml.cs b/src/App/Pages/Accounts/LoginPage.xaml.cs index 09be8cb4a..fd1fa7a09 100644 --- a/src/App/Pages/Accounts/LoginPage.xaml.cs +++ b/src/App/Pages/Accounts/LoginPage.xaml.cs @@ -4,6 +4,7 @@ using Bit.App.Models; using Bit.App.Utilities; using Bit.Core; using Bit.Core.Abstractions; +using Bit.Core.Enums; using Bit.Core.Services; using Bit.Core.Utilities; using Xamarin.CommunityToolkit.ObjectModel; @@ -135,7 +136,7 @@ namespace Bit.App.Pages private async Task StartLoginWithDeviceAsync() { - var page = new LoginPasswordlessRequestPage(_vm.Email, _appOptions); + var page = new LoginPasswordlessRequestPage(_vm.Email, AuthRequestType.LoginWithDevice, _appOptions); await Navigation.PushModalAsync(new NavigationPage(page)); } diff --git a/src/App/Pages/Accounts/LoginPasswordlessRequestPage.xaml.cs b/src/App/Pages/Accounts/LoginPasswordlessRequestPage.xaml.cs index 383161c7c..332875595 100644 --- a/src/App/Pages/Accounts/LoginPasswordlessRequestPage.xaml.cs +++ b/src/App/Pages/Accounts/LoginPasswordlessRequestPage.xaml.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using Bit.App.Models; using Bit.App.Utilities; +using Bit.Core.Enums; using Xamarin.Forms; namespace Bit.App.Pages @@ -12,7 +13,7 @@ namespace Bit.App.Pages private LoginPasswordlessRequestViewModel _vm; private readonly AppOptions _appOptions; - public LoginPasswordlessRequestPage(string email, AppOptions appOptions = null) + public LoginPasswordlessRequestPage(string email, AuthRequestType authRequestType, AppOptions appOptions = null) { InitializeComponent(); _appOptions = appOptions; diff --git a/src/Core/Abstractions/IApiService.cs b/src/Core/Abstractions/IApiService.cs index e393689a4..0838e8f92 100644 --- a/src/Core/Abstractions/IApiService.cs +++ b/src/Core/Abstractions/IApiService.cs @@ -4,6 +4,7 @@ using System.Net; using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using Bit.Core.Enums; using Bit.Core.Models.Domain; using Bit.Core.Models.Request; using Bit.Core.Models.Response; diff --git a/src/Core/Enums/AuthRequestType.cs b/src/Core/Enums/AuthRequestType.cs new file mode 100644 index 000000000..d646bc59f --- /dev/null +++ b/src/Core/Enums/AuthRequestType.cs @@ -0,0 +1,10 @@ +using System; +namespace Bit.Core.Enums +{ + public enum AuthRequestType + { + LoginWithDevice, + AdminApproval, + } +} + diff --git a/src/iOS.Autofill/CredentialProviderViewController.cs b/src/iOS.Autofill/CredentialProviderViewController.cs index 374a28ab6..973a316f5 100644 --- a/src/iOS.Autofill/CredentialProviderViewController.cs +++ b/src/iOS.Autofill/CredentialProviderViewController.cs @@ -515,7 +515,7 @@ namespace Bit.iOS.Autofill { var appOptions = new AppOptions { IosExtension = true }; var app = new App.App(appOptions); - var loginWithDevicePage = new LoginPasswordlessRequestPage(email, appOptions); + var loginWithDevicePage = new LoginPasswordlessRequestPage(email, AuthRequestType.LoginWithDevice, appOptions); ThemeManager.SetTheme(app.Resources); ThemeManager.ApplyResourcesTo(loginWithDevicePage); if (loginWithDevicePage.BindingContext is LoginPasswordlessRequestViewModel vm) diff --git a/src/iOS.Extension/LoadingViewController.cs b/src/iOS.Extension/LoadingViewController.cs index 307bb1c54..654c7bb88 100644 --- a/src/iOS.Extension/LoadingViewController.cs +++ b/src/iOS.Extension/LoadingViewController.cs @@ -20,6 +20,7 @@ using Bit.App.Pages; using Bit.App.Models; using Bit.App.Utilities; using Bit.iOS.Core.Views; +using Bit.Core.Enums; namespace Bit.iOS.Extension { @@ -536,7 +537,7 @@ namespace Bit.iOS.Extension { var appOptions = new AppOptions { IosExtension = true }; var app = new App.App(appOptions); - var loginWithDevicePage = new LoginPasswordlessRequestPage(email, appOptions); + var loginWithDevicePage = new LoginPasswordlessRequestPage(email, AuthRequestType.LoginWithDevice, appOptions); ThemeManager.SetTheme(app.Resources); ThemeManager.ApplyResourcesTo(loginWithDevicePage); if (loginWithDevicePage.BindingContext is LoginPasswordlessRequestViewModel vm) diff --git a/src/iOS.ShareExtension/LoadingViewController.cs b/src/iOS.ShareExtension/LoadingViewController.cs index de1281558..0a91e9d38 100644 --- a/src/iOS.ShareExtension/LoadingViewController.cs +++ b/src/iOS.ShareExtension/LoadingViewController.cs @@ -350,7 +350,7 @@ namespace Bit.iOS.ShareExtension private void LaunchLoginWithDevice(string email = null) { - var loginWithDevicePage = new LoginPasswordlessRequestPage(email, _appOptions.Value); + var loginWithDevicePage = new LoginPasswordlessRequestPage(email, AuthRequestType.LoginWithDevice, _appOptions.Value); SetupAppAndApplyResources(loginWithDevicePage); if (loginWithDevicePage.BindingContext is LoginPasswordlessRequestViewModel vm) {