fixes to SSO process (#1395)

This commit is contained in:
Kyle Spearrin 2020-09-18 16:03:08 -04:00 committed by GitHub
parent ad4d67cc49
commit bf967089d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 12 deletions

2
jslib

@ -1 +1 @@
Subproject commit 5e0a2d1d998b5d36b093f3eff032453421680a41 Subproject commit 0a20face13a0cf57c25fbd44840378cc0d0afc02

View File

@ -52,6 +52,7 @@ import {
UserService as UserServiceAbstraction, UserService as UserServiceAbstraction,
VaultTimeoutService as VaultTimeoutServiceAbstraction, VaultTimeoutService as VaultTimeoutServiceAbstraction,
} from 'jslib/abstractions'; } from 'jslib/abstractions';
import { CryptoFunctionService as CryptoFunctionServiceAbstraction } from 'jslib/abstractions/cryptoFunction.service';
import { EventService as EventServiceAbstraction } from 'jslib/abstractions/event.service'; import { EventService as EventServiceAbstraction } from 'jslib/abstractions/event.service';
import { ExportService as ExportServiceAbstraction } from 'jslib/abstractions/export.service'; import { ExportService as ExportServiceAbstraction } from 'jslib/abstractions/export.service';
import { NotificationsService as NotificationsServiceAbstraction } from 'jslib/abstractions/notifications.service'; import { NotificationsService as NotificationsServiceAbstraction } from 'jslib/abstractions/notifications.service';
@ -90,6 +91,7 @@ export default class MainBackground {
platformUtilsService: PlatformUtilsServiceAbstraction; platformUtilsService: PlatformUtilsServiceAbstraction;
constantsService: ConstantsService; constantsService: ConstantsService;
cryptoService: CryptoServiceAbstraction; cryptoService: CryptoServiceAbstraction;
cryptoFunctionService: CryptoFunctionServiceAbstraction;
tokenService: TokenServiceAbstraction; tokenService: TokenServiceAbstraction;
appIdService: AppIdServiceAbstraction; appIdService: AppIdServiceAbstraction;
apiService: ApiServiceAbstraction; apiService: ApiServiceAbstraction;
@ -148,8 +150,9 @@ export default class MainBackground {
this.storageService = new BrowserStorageService(this.platformUtilsService); this.storageService = new BrowserStorageService(this.platformUtilsService);
this.secureStorageService = new BrowserStorageService(this.platformUtilsService); this.secureStorageService = new BrowserStorageService(this.platformUtilsService);
this.i18nService = new I18nService(BrowserApi.getUILanguage(window)); this.i18nService = new I18nService(BrowserApi.getUILanguage(window));
const cryptoFunctionService = new WebCryptoFunctionService(window, this.platformUtilsService); this.cryptoFunctionService = new WebCryptoFunctionService(window, this.platformUtilsService);
this.cryptoService = new CryptoService(this.storageService, this.secureStorageService, cryptoFunctionService); this.cryptoService = new CryptoService(this.storageService, this.secureStorageService,
this.cryptoFunctionService);
this.tokenService = new TokenService(this.storageService); this.tokenService = new TokenService(this.storageService);
this.appIdService = new AppIdService(this.storageService); this.appIdService = new AppIdService(this.storageService);
this.apiService = new ApiService(this.tokenService, this.platformUtilsService, this.apiService = new ApiService(this.tokenService, this.platformUtilsService,
@ -190,11 +193,11 @@ export default class MainBackground {
this.cipherService); this.cipherService);
this.passwordGenerationService = new PasswordGenerationService(this.cryptoService, this.storageService, this.passwordGenerationService = new PasswordGenerationService(this.cryptoService, this.storageService,
this.policyService); this.policyService);
this.totpService = new TotpService(this.storageService, cryptoFunctionService); this.totpService = new TotpService(this.storageService, this.cryptoFunctionService);
this.autofillService = new AutofillService(this.cipherService, this.userService, this.totpService, this.autofillService = new AutofillService(this.cipherService, this.userService, this.totpService,
this.eventService); this.eventService);
this.containerService = new ContainerService(this.cryptoService); this.containerService = new ContainerService(this.cryptoService);
this.auditService = new AuditService(cryptoFunctionService, this.apiService); this.auditService = new AuditService(this.cryptoFunctionService, this.apiService);
this.exportService = new ExportService(this.folderService, this.cipherService, this.apiService); this.exportService = new ExportService(this.folderService, this.cipherService, this.apiService);
this.notificationsService = new NotificationsService(this.userService, this.syncService, this.appIdService, this.notificationsService = new NotificationsService(this.userService, this.syncService, this.appIdService,
this.apiService, this.vaultTimeoutService, () => this.logout(true)); this.apiService, this.vaultTimeoutService, () => this.logout(true));

View File

@ -174,9 +174,8 @@ export default class RuntimeBackground {
} }
try { try {
chrome.tabs.create({ BrowserApi.createNewTab('popup/index.html?uilocation=popout#/sso?code=' +
url: 'popup/index.html?uilocation=popout#/sso?code=' + msg.code + '&state=' + msg.state msg.code + '&state=' + msg.state);
});
} }
catch { } catch { }
break; break;

View File

@ -215,10 +215,10 @@ export class BrowserApi {
static reloadOpenWindows() { static reloadOpenWindows() {
if (!BrowserApi.isSafariApi) { if (!BrowserApi.isSafariApi) {
const sidebarWindows = chrome.extension.getViews({ type: 'sidebar' }); const views = chrome.extension.getViews() as Window[];
if (sidebarWindows && sidebarWindows.length > 0) { views.filter((w) => w.location.href != null).forEach((w) => {
sidebarWindows[0].location.reload(); w.location.reload();
} });
} }
} }
} }