1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-15 15:53:41 +00:00

custom api endpoints via settings

This commit is contained in:
Kyle Spearrin
2017-05-12 14:04:56 -04:00
parent 44563451f2
commit fa0049df3c
3 changed files with 41 additions and 3 deletions

View File

@@ -16,10 +16,20 @@ namespace Bit.Core.Services
private ApiService()
{
ApiClient = new HttpClient();
ApiClient.BaseAddress = new Uri("https://api.bitwarden.com");
var apiUrl = "https://api.bitwarden.com";
if(!string.IsNullOrWhiteSpace(SettingsService.Instance.ApiBaseUrl))
{
apiUrl = SettingsService.Instance.ApiBaseUrl;
}
ApiClient.BaseAddress = new Uri(apiUrl);
IdentityClient = new HttpClient();
IdentityClient.BaseAddress = new Uri("https://identity.bitwarden.com");
var identityUrl = "https://identity.bitwarden.com";
if(!string.IsNullOrWhiteSpace(SettingsService.Instance.IdentityBaseUrl))
{
identityUrl = SettingsService.Instance.IdentityBaseUrl;
}
IdentityClient.BaseAddress = new Uri(identityUrl);
}
public static ApiService Instance