mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
remove to web vault url
This commit is contained in:
parent
910f0083cd
commit
5932dd99ad
7 changed files with 35 additions and 35 deletions
|
@ -11,7 +11,7 @@ namespace Bit.App.Abstractions
|
|||
bool AutofillPasswordField { get; set; }
|
||||
string SecurityStamp { get; set; }
|
||||
string BaseUrl { get; set; }
|
||||
string VaultUrl { get; set; }
|
||||
string WebVaultUrl { get; set; }
|
||||
string ApiUrl { get; set; }
|
||||
string IdentityUrl { get; set; }
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
public const string LastSync = "other:lastSync";
|
||||
public const string LastBuildKey = "LastBuild";
|
||||
public const string BaseUrl = "other:baseUrl";
|
||||
public const string VaultUrl = "other:vaultUrl";
|
||||
public const string WebVaultUrl = "other:webVaultUrl";
|
||||
public const string ApiUrl = "other:apiUrl";
|
||||
public const string IdentityUrl = "other:identityUrl";
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace Bit.App.Pages
|
|||
}
|
||||
|
||||
public FormEntryCell BaseUrlCell { get; set; }
|
||||
public FormEntryCell VaultUrlCell { get; set; }
|
||||
public FormEntryCell WebVaultUrlCell { get; set; }
|
||||
public FormEntryCell ApiUrlCell { get; set; }
|
||||
public FormEntryCell IdentityUrlCell { get; set; }
|
||||
public StackLayout StackLayout { get; set; }
|
||||
|
@ -41,9 +41,9 @@ namespace Bit.App.Pages
|
|||
IdentityUrlCell.Entry.Text = _appSettings.IdentityUrl;
|
||||
ApiUrlCell = new FormEntryCell(AppResources.ApiUrl, nextElement: IdentityUrlCell.Entry, entryKeyboard: Keyboard.Url);
|
||||
ApiUrlCell.Entry.Text = _appSettings.ApiUrl;
|
||||
VaultUrlCell = new FormEntryCell(AppResources.VaultUrl, nextElement: ApiUrlCell.Entry, entryKeyboard: Keyboard.Url);
|
||||
VaultUrlCell.Entry.Text = _appSettings.VaultUrl;
|
||||
BaseUrlCell = new FormEntryCell(AppResources.ServerUrl, nextElement: VaultUrlCell.Entry, entryKeyboard: Keyboard.Url);
|
||||
WebVaultUrlCell = new FormEntryCell(AppResources.WebVaultUrl, nextElement: ApiUrlCell.Entry, entryKeyboard: Keyboard.Url);
|
||||
WebVaultUrlCell.Entry.Text = _appSettings.WebVaultUrl;
|
||||
BaseUrlCell = new FormEntryCell(AppResources.ServerUrl, nextElement: WebVaultUrlCell.Entry, entryKeyboard: Keyboard.Url);
|
||||
BaseUrlCell.Entry.Text = _appSettings.BaseUrl;
|
||||
|
||||
var table = new FormTableView
|
||||
|
@ -72,7 +72,7 @@ namespace Bit.App.Pages
|
|||
{
|
||||
new TableSection(AppResources.CustomEnvironment)
|
||||
{
|
||||
VaultUrlCell,
|
||||
WebVaultUrlCell,
|
||||
ApiUrlCell,
|
||||
IdentityUrlCell
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ namespace Bit.App.Pages
|
|||
BaseUrlCell.InitEvents();
|
||||
IdentityUrlCell.InitEvents();
|
||||
ApiUrlCell.InitEvents();
|
||||
VaultUrlCell.InitEvents();
|
||||
WebVaultUrlCell.InitEvents();
|
||||
StackLayout.LayoutChanged += Layout_LayoutChanged;
|
||||
BaseUrlCell.Entry.FocusWithDelay();
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ namespace Bit.App.Pages
|
|||
BaseUrlCell.Dispose();
|
||||
IdentityUrlCell.Dispose();
|
||||
ApiUrlCell.Dispose();
|
||||
VaultUrlCell.Dispose();
|
||||
WebVaultUrlCell.Dispose();
|
||||
StackLayout.LayoutChanged -= Layout_LayoutChanged;
|
||||
}
|
||||
|
||||
|
@ -162,18 +162,18 @@ namespace Bit.App.Pages
|
|||
BaseUrlCell.Entry.Text = null;
|
||||
}
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(VaultUrlCell.Entry.Text))
|
||||
if(!string.IsNullOrWhiteSpace(WebVaultUrlCell.Entry.Text))
|
||||
{
|
||||
VaultUrlCell.Entry.Text = FixUrl(VaultUrlCell.Entry.Text);
|
||||
if(!Uri.TryCreate(VaultUrlCell.Entry.Text, UriKind.Absolute, out result))
|
||||
WebVaultUrlCell.Entry.Text = FixUrl(WebVaultUrlCell.Entry.Text);
|
||||
if(!Uri.TryCreate(WebVaultUrlCell.Entry.Text, UriKind.Absolute, out result))
|
||||
{
|
||||
_userDialogs.Alert(string.Format(AppResources.FormattedIncorrectly, AppResources.VaultUrl));
|
||||
_userDialogs.Alert(string.Format(AppResources.FormattedIncorrectly, AppResources.WebVaultUrl));
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VaultUrlCell.Entry.Text = null;
|
||||
WebVaultUrlCell.Entry.Text = null;
|
||||
}
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(ApiUrlCell.Entry.Text))
|
||||
|
@ -207,7 +207,7 @@ namespace Bit.App.Pages
|
|||
_appSettings.BaseUrl = BaseUrlCell.Entry.Text;
|
||||
_appSettings.IdentityUrl = IdentityUrlCell.Entry.Text;
|
||||
_appSettings.ApiUrl = ApiUrlCell.Entry.Text;
|
||||
_appSettings.VaultUrl = VaultUrlCell.Entry.Text;
|
||||
_appSettings.WebVaultUrl = WebVaultUrlCell.Entry.Text;
|
||||
_userDialogs.Toast(AppResources.EnvironmentSaved);
|
||||
_googleAnalyticsService.TrackAppEvent("SetEnvironmentUrls");
|
||||
await Navigation.PopForDeviceAsync();
|
||||
|
|
|
@ -187,19 +187,19 @@ namespace Bit.App.Pages
|
|||
var host = WebUtility.UrlEncode(duoParams["Host"].ToString());
|
||||
var req = WebUtility.UrlEncode(duoParams["Signature"].ToString());
|
||||
|
||||
var vaultUrl = "https://vault.bitwarden.com";
|
||||
var webVaultUrl = "https://vault.bitwarden.com";
|
||||
if(!string.IsNullOrWhiteSpace(_appSettingsService.BaseUrl))
|
||||
{
|
||||
vaultUrl = _appSettingsService.BaseUrl;
|
||||
webVaultUrl = _appSettingsService.BaseUrl;
|
||||
}
|
||||
else if(!string.IsNullOrWhiteSpace(_appSettingsService.VaultUrl))
|
||||
else if(!string.IsNullOrWhiteSpace(_appSettingsService.WebVaultUrl))
|
||||
{
|
||||
vaultUrl = _appSettingsService.VaultUrl;
|
||||
webVaultUrl = _appSettingsService.WebVaultUrl;
|
||||
}
|
||||
|
||||
var webView = new HybridWebView
|
||||
{
|
||||
Uri = $"{vaultUrl}/duo-connector.html?host={host}&request={req}",
|
||||
Uri = $"{webVaultUrl}/duo-connector.html?host={host}&request={req}",
|
||||
HorizontalOptions = LayoutOptions.FillAndExpand,
|
||||
VerticalOptions = LayoutOptions.FillAndExpand,
|
||||
MinimumHeightRequest = 400
|
||||
|
|
18
src/App/Resources/AppResources.Designer.cs
generated
18
src/App/Resources/AppResources.Designer.cs
generated
|
@ -2392,15 +2392,6 @@ namespace Bit.App.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Vault Server URL.
|
||||
/// </summary>
|
||||
public static string VaultUrl {
|
||||
get {
|
||||
return ResourceManager.GetString("VaultUrl", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Verification Code.
|
||||
/// </summary>
|
||||
|
@ -2536,6 +2527,15 @@ namespace Bit.App.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Web Vault Server URL.
|
||||
/// </summary>
|
||||
public static string WebVaultUrl {
|
||||
get {
|
||||
return ResourceManager.GetString("WebVaultUrl", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Yes.
|
||||
/// </summary>
|
||||
|
|
|
@ -1024,7 +1024,7 @@
|
|||
<data name="ServerUrl" xml:space="preserve">
|
||||
<value>Server URL</value>
|
||||
</data>
|
||||
<data name="VaultUrl" xml:space="preserve">
|
||||
<value>Vault Server URL</value>
|
||||
<data name="WebVaultUrl" xml:space="preserve">
|
||||
<value>Web Vault Server URL</value>
|
||||
</data>
|
||||
</root>
|
|
@ -104,21 +104,21 @@ namespace Bit.App.Services
|
|||
}
|
||||
}
|
||||
|
||||
public string VaultUrl
|
||||
public string WebVaultUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
return _settings.GetValueOrDefault<string>(Constants.VaultUrl);
|
||||
return _settings.GetValueOrDefault<string>(Constants.WebVaultUrl);
|
||||
}
|
||||
set
|
||||
{
|
||||
if(value == null)
|
||||
{
|
||||
_settings.Remove(Constants.VaultUrl);
|
||||
_settings.Remove(Constants.WebVaultUrl);
|
||||
return;
|
||||
}
|
||||
|
||||
_settings.AddOrUpdateValue(Constants.VaultUrl, value);
|
||||
_settings.AddOrUpdateValue(Constants.WebVaultUrl, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue