1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-21 12:05:42 +01:00

Register noop notification registration service for self host lacking necessary data (#4939)

This commit is contained in:
Matt Gibson 2024-10-24 12:45:13 -07:00 committed by GitHub
parent 9a499df0e7
commit f43f59e4b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -274,6 +274,11 @@ public static class ServiceCollectionExtensions
services.AddKeyedSingleton<IPushNotificationService, RelayPushNotificationService>("implementation"); services.AddKeyedSingleton<IPushNotificationService, RelayPushNotificationService>("implementation");
services.AddSingleton<IPushRegistrationService, RelayPushRegistrationService>(); services.AddSingleton<IPushRegistrationService, RelayPushRegistrationService>();
} }
else
{
services.AddSingleton<IPushRegistrationService, NoopPushRegistrationService>();
}
if (CoreHelpers.SettingHasValue(globalSettings.InternalIdentityKey) && if (CoreHelpers.SettingHasValue(globalSettings.InternalIdentityKey) &&
CoreHelpers.SettingHasValue(globalSettings.BaseServiceUri.InternalNotifications)) CoreHelpers.SettingHasValue(globalSettings.BaseServiceUri.InternalNotifications))
{ {
@ -290,10 +295,6 @@ public static class ServiceCollectionExtensions
services.AddKeyedSingleton<IPushNotificationService, AzureQueuePushNotificationService>("implementation"); services.AddKeyedSingleton<IPushNotificationService, AzureQueuePushNotificationService>("implementation");
} }
} }
else
{
services.AddSingleton<IPushRegistrationService, NoopPushRegistrationService>();
}
if (!globalSettings.SelfHosted && CoreHelpers.SettingHasValue(globalSettings.Mail.ConnectionString)) if (!globalSettings.SelfHosted && CoreHelpers.SettingHasValue(globalSettings.Mail.ConnectionString))
{ {