mirror of
https://github.com/bitwarden/mobile
synced 2025-12-05 23:53:33 +00:00
Initial commit for new user provision flow (#1091)
This commit is contained in:
@@ -93,14 +93,14 @@ namespace Bit.App.Pages
|
|||||||
private async Task StartTwoFactorAsync()
|
private async Task StartTwoFactorAsync()
|
||||||
{
|
{
|
||||||
RestoreAppOptionsFromCopy();
|
RestoreAppOptionsFromCopy();
|
||||||
var page = new TwoFactorPage(true, _appOptions);
|
var page = new TwoFactorPage(true, _appOptions, _vm.OrgIdentifier);
|
||||||
await Navigation.PushModalAsync(new NavigationPage(page));
|
await Navigation.PushModalAsync(new NavigationPage(page));
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task StartSetPasswordAsync()
|
private async Task StartSetPasswordAsync()
|
||||||
{
|
{
|
||||||
RestoreAppOptionsFromCopy();
|
RestoreAppOptionsFromCopy();
|
||||||
var page = new SetPasswordPage(_appOptions);
|
var page = new SetPasswordPage(_appOptions, _vm.OrgIdentifier);
|
||||||
await Navigation.PushModalAsync(new NavigationPage(page));
|
await Navigation.PushModalAsync(new NavigationPage(page));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Bit.App.Pages
|
|||||||
private readonly SetPasswordPageViewModel _vm;
|
private readonly SetPasswordPageViewModel _vm;
|
||||||
private readonly AppOptions _appOptions;
|
private readonly AppOptions _appOptions;
|
||||||
|
|
||||||
public SetPasswordPage(AppOptions appOptions = null)
|
public SetPasswordPage(AppOptions appOptions = null, string orgIdentifier = null)
|
||||||
{
|
{
|
||||||
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
|
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
|
||||||
_messagingService.Send("showStatusBar", true);
|
_messagingService.Send("showStatusBar", true);
|
||||||
@@ -29,6 +29,7 @@ namespace Bit.App.Pages
|
|||||||
_messagingService.Send("showStatusBar", false);
|
_messagingService.Send("showStatusBar", false);
|
||||||
await Navigation.PopModalAsync();
|
await Navigation.PopModalAsync();
|
||||||
};
|
};
|
||||||
|
_vm.OrgIdentifier = orgIdentifier;
|
||||||
if (Device.RuntimePlatform == Device.Android)
|
if (Device.RuntimePlatform == Device.Android)
|
||||||
{
|
{
|
||||||
ToolbarItems.RemoveAt(0);
|
ToolbarItems.RemoveAt(0);
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ namespace Bit.App.Pages
|
|||||||
public string Hint { get; set; }
|
public string Hint { get; set; }
|
||||||
public Action SetPasswordSuccessAction { get; set; }
|
public Action SetPasswordSuccessAction { get; set; }
|
||||||
public Action CloseAction { get; set; }
|
public Action CloseAction { get; set; }
|
||||||
|
public string OrgIdentifier { get; set; }
|
||||||
|
|
||||||
public async Task InitAsync()
|
public async Task InitAsync()
|
||||||
{
|
{
|
||||||
@@ -158,6 +159,7 @@ namespace Bit.App.Pages
|
|||||||
MasterPasswordHint = Hint,
|
MasterPasswordHint = Hint,
|
||||||
Kdf = kdf,
|
Kdf = kdf,
|
||||||
KdfIterations = kdfIterations,
|
KdfIterations = kdfIterations,
|
||||||
|
OrgIdentifier = OrgIdentifier,
|
||||||
Keys = new KeysRequest
|
Keys = new KeysRequest
|
||||||
{
|
{
|
||||||
PublicKey = keys.Item1,
|
PublicKey = keys.Item1,
|
||||||
|
|||||||
@@ -20,13 +20,15 @@ namespace Bit.App.Pages
|
|||||||
private TwoFactorPageViewModel _vm;
|
private TwoFactorPageViewModel _vm;
|
||||||
private bool _inited;
|
private bool _inited;
|
||||||
private bool _authingWithSso;
|
private bool _authingWithSso;
|
||||||
|
private string _orgIdentifier;
|
||||||
|
|
||||||
public TwoFactorPage(bool? authingWithSso = false, AppOptions appOptions = null)
|
public TwoFactorPage(bool? authingWithSso = false, AppOptions appOptions = null, string orgIdentifier = null)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
SetActivityIndicator();
|
SetActivityIndicator();
|
||||||
_authingWithSso = authingWithSso ?? false;
|
_authingWithSso = authingWithSso ?? false;
|
||||||
_appOptions = appOptions;
|
_appOptions = appOptions;
|
||||||
|
_orgIdentifier = orgIdentifier;
|
||||||
_storageService = ServiceContainer.Resolve<IStorageService>("storageService");
|
_storageService = ServiceContainer.Resolve<IStorageService>("storageService");
|
||||||
_broadcasterService = ServiceContainer.Resolve<IBroadcasterService>("broadcasterService");
|
_broadcasterService = ServiceContainer.Resolve<IBroadcasterService>("broadcasterService");
|
||||||
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
|
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
|
||||||
@@ -170,7 +172,7 @@ namespace Bit.App.Pages
|
|||||||
private async Task StartSetPasswordAsync()
|
private async Task StartSetPasswordAsync()
|
||||||
{
|
{
|
||||||
_vm.CloseAction();
|
_vm.CloseAction();
|
||||||
var page = new SetPasswordPage(_appOptions);
|
var page = new SetPasswordPage(_appOptions, _orgIdentifier);
|
||||||
await Navigation.PushModalAsync(new NavigationPage(page));
|
await Navigation.PushModalAsync(new NavigationPage(page));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,5 +10,6 @@ namespace Bit.Core.Models.Request
|
|||||||
public KeysRequest Keys { get; set; }
|
public KeysRequest Keys { get; set; }
|
||||||
public KdfType Kdf { get; set; }
|
public KdfType Kdf { get; set; }
|
||||||
public int KdfIterations { get; set; }
|
public int KdfIterations { get; set; }
|
||||||
|
public string OrgIdentifier { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user