mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 11:13:46 +00:00
Add support for helpers in environment service (#1967)
This commit is contained in:
@@ -178,7 +178,8 @@ export default class MainBackground {
|
||||
this.cryptoFunctionService, this.platformUtilsService, this.logService);
|
||||
this.tokenService = new TokenService(this.storageService);
|
||||
this.appIdService = new AppIdService(this.storageService);
|
||||
this.apiService = new ApiService(this.tokenService, this.platformUtilsService,
|
||||
this.environmentService = new EnvironmentService(this.storageService);
|
||||
this.apiService = new ApiService(this.tokenService, this.platformUtilsService, this.environmentService,
|
||||
(expired: boolean) => this.logout(expired));
|
||||
this.userService = new UserService(this.tokenService, this.storageService);
|
||||
this.settingsService = new SettingsService(this.userService, this.storageService);
|
||||
@@ -224,9 +225,7 @@ export default class MainBackground {
|
||||
this.exportService = new ExportService(this.folderService, this.cipherService, this.apiService,
|
||||
this.cryptoService);
|
||||
this.notificationsService = new NotificationsService(this.userService, this.syncService, this.appIdService,
|
||||
this.apiService, this.vaultTimeoutService, () => this.logout(true), this.logService);
|
||||
this.environmentService = new EnvironmentService(this.apiService, this.storageService,
|
||||
this.notificationsService);
|
||||
this.apiService, this.vaultTimeoutService, this.environmentService, () => this.logout(true), this.logService);
|
||||
this.popupUtilsService = new PopupUtilsService(this.platformUtilsService);
|
||||
this.systemService = new SystemService(this.storageService, this.vaultTimeoutService,
|
||||
this.messagingService, this.platformUtilsService, () => {
|
||||
@@ -295,7 +294,7 @@ export default class MainBackground {
|
||||
await this.setIcon();
|
||||
this.cleanupNotificationQueue();
|
||||
this.fullSync(true);
|
||||
setTimeout(() => this.notificationsService.init(this.environmentService), 2500);
|
||||
setTimeout(() => this.notificationsService.init(), 2500);
|
||||
resolve();
|
||||
}, 500);
|
||||
});
|
||||
|
||||
@@ -161,10 +161,7 @@ export default class RuntimeBackground {
|
||||
}
|
||||
break;
|
||||
case 'authResult':
|
||||
let vaultUrl = this.environmentService.getWebVaultUrl();
|
||||
if (vaultUrl == null) {
|
||||
vaultUrl = 'https://vault.bitwarden.com';
|
||||
}
|
||||
const vaultUrl = this.environmentService.getWebVaultUrl();
|
||||
|
||||
if (msg.referrer == null || Utils.getHostname(vaultUrl) !== msg.referrer) {
|
||||
return;
|
||||
@@ -177,10 +174,7 @@ export default class RuntimeBackground {
|
||||
catch { }
|
||||
break;
|
||||
case 'webAuthnResult':
|
||||
let vaultUrl2 = this.environmentService.getWebVaultUrl();
|
||||
if (vaultUrl2 == null) {
|
||||
vaultUrl2 = 'https://vault.bitwarden.com';
|
||||
}
|
||||
const vaultUrl2 = this.environmentService.getWebVaultUrl();
|
||||
|
||||
if (msg.referrer == null || Utils.getHostname(vaultUrl2) !== msg.referrer) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user