1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-02 18:06:07 +02:00

check SettingHasValue instead of empty

This commit is contained in:
Kyle Spearrin 2020-03-19 11:10:23 -04:00
parent 981d6a0526
commit 1331cc90f7

View File

@ -42,7 +42,7 @@ namespace Bit.Core.Utilities
{
public static void AddSqlServerRepositories(this IServiceCollection services, GlobalSettings globalSettings)
{
var usePostgreSql = !string.IsNullOrWhiteSpace(globalSettings.PostgreSql?.ConnectionString);
var usePostgreSql = CoreHelpers.SettingHasValue(globalSettings.PostgreSql?.ConnectionString);
var useEf = usePostgreSql;
if(useEf)
@ -354,16 +354,17 @@ namespace Bit.Core.Utilities
identityServerBuilder.AddDeveloperSigningCredential(false);
}
else if(globalSettings.SelfHosted &&
!string.IsNullOrWhiteSpace(globalSettings.IdentityServer.CertificatePassword)
CoreHelpers.SettingHasValue(globalSettings.IdentityServer.CertificatePassword)
&& File.Exists("identity.pfx"))
{
var identityServerCert = CoreHelpers.GetCertificate("identity.pfx",
globalSettings.IdentityServer.CertificatePassword);
identityServerBuilder.AddSigningCredential(identityServerCert);
}
else if(!string.IsNullOrWhiteSpace(globalSettings.IdentityServer.CertificateThumbprint))
else if(CoreHelpers.SettingHasValue(globalSettings.IdentityServer.CertificateThumbprint))
{
var identityServerCert = CoreHelpers.GetCertificate(globalSettings.IdentityServer.CertificateThumbprint);
var identityServerCert = CoreHelpers.GetCertificate(
globalSettings.IdentityServer.CertificateThumbprint);
identityServerBuilder.AddSigningCredential(identityServerCert);
}
else if(!globalSettings.SelfHosted &&