mirror of
https://github.com/bitwarden/server.git
synced 2025-05-28 23:04:50 -05:00
do things when not dev
This commit is contained in:
parent
25fccfc3fd
commit
64212a1874
@ -180,7 +180,7 @@ namespace Bit.Api
|
||||
{
|
||||
Authority = authority,
|
||||
AllowedScopes = new string[] { "api" },
|
||||
RequireHttpsMetadata = env.IsProduction(),
|
||||
RequireHttpsMetadata = !env.IsDevelopment(),
|
||||
ApiName = "api",
|
||||
NameClaimType = ClaimTypes.Email,
|
||||
// Suffix until we retire the old jwt schemes.
|
||||
|
@ -15,7 +15,7 @@ namespace Bit.Core.Utilities
|
||||
GlobalSettings globalSettings,
|
||||
Func<LogEvent, bool> filter = null)
|
||||
{
|
||||
if(env.IsProduction())
|
||||
if(!env.IsDevelopment())
|
||||
{
|
||||
if(filter == null)
|
||||
{
|
||||
|
@ -132,14 +132,14 @@ namespace Bit.Core.Utilities
|
||||
|
||||
services.AddTransient<ICorsPolicyService, AllowAllCorsPolicyService>();
|
||||
|
||||
if(env.IsProduction())
|
||||
if(env.IsDevelopment())
|
||||
{
|
||||
var identityServerCert = CoreHelpers.GetCertificate(globalSettings.IdentityServer.CertificateThumbprint);
|
||||
identityServerBuilder.AddSigningCredential(identityServerCert);
|
||||
identityServerBuilder.AddTemporarySigningCredential();
|
||||
}
|
||||
else
|
||||
{
|
||||
identityServerBuilder.AddTemporarySigningCredential();
|
||||
var identityServerCert = CoreHelpers.GetCertificate(globalSettings.IdentityServer.CertificateThumbprint);
|
||||
identityServerBuilder.AddSigningCredential(identityServerCert);
|
||||
}
|
||||
|
||||
services.AddScoped<IResourceOwnerPasswordValidator, ResourceOwnerPasswordValidator>();
|
||||
@ -152,7 +152,7 @@ namespace Bit.Core.Utilities
|
||||
public static void AddCustomDataProtectionServices(
|
||||
this IServiceCollection services, IHostingEnvironment env, GlobalSettings globalSettings)
|
||||
{
|
||||
if(env.IsProduction())
|
||||
if(!env.IsDevelopment())
|
||||
{
|
||||
var dataProtectionCert = CoreHelpers.GetCertificate(globalSettings.DataProtection.CertificateThumbprint);
|
||||
var storageAccount = CloudStorageAccount.Parse(globalSettings.Storage.ConnectionString);
|
||||
|
Loading…
x
Reference in New Issue
Block a user