mirror of
https://github.com/bitwarden/browser
synced 2026-02-13 23:13:36 +00:00
* create mp and kdf service * update mp service interface to not rely on active user * rename observable methods * update crypto service with new MP service * add master password service to login strategies - make fake service for easier testing - fix crypto service tests * update auth service and finish strategies * auth request refactors * more service refactors and constructor updates * setMasterKey refactors * remove master key methods from crypto service * remove master key and hash from state service * missed fixes * create migrations and fix references * fix master key imports * default force set password reason to none * add password reset reason observable factory to service * remove kdf changes and migrate only disk data * update migration number * fix sync service deps * use disk for force set password state * fix desktop migration * fix sso test * fix tests * fix more tests * fix even more tests * fix even more tests * fix cli * remove kdf service abstraction * add missing deps for browser * fix merge conflicts * clear reset password reason on lock or logout * fix tests * fix other tests * add jsdocs to abstraction * use state provider in crypto service * inverse master password service factory * add clearOn to master password service * add parameter validation to master password service * add component level userId * add missed userId * migrate key hash * fix login strategy service * delete crypto master key from account * migrate master key encrypted user key * rename key hash to master key hash * use mp service for getMasterKeyEncryptedUserKey * fix tests * fix user key decryption logic * add clear methods to mp service * fix circular dep and encryption issue * fix test * remove extra account service call * use EncString in state provider * fix tests * return to using encrypted string for serialization
81 lines
3.5 KiB
TypeScript
81 lines
3.5 KiB
TypeScript
import { Component } from "@angular/core";
|
|
import { ActivatedRoute, Router } from "@angular/router";
|
|
|
|
import { SsoComponent as BaseSsoComponent } from "@bitwarden/angular/auth/components/sso.component";
|
|
import {
|
|
LoginStrategyServiceAbstraction,
|
|
UserDecryptionOptionsServiceAbstraction,
|
|
} from "@bitwarden/auth/common";
|
|
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
|
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
|
import { InternalMasterPasswordServiceAbstraction } from "@bitwarden/common/auth/abstractions/master-password.service.abstraction";
|
|
import { SsoLoginServiceAbstraction } from "@bitwarden/common/auth/abstractions/sso-login.service.abstraction";
|
|
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
|
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
|
|
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
|
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
|
import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
|
|
import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password";
|
|
import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
|
|
|
@Component({
|
|
selector: "app-sso",
|
|
templateUrl: "sso.component.html",
|
|
})
|
|
export class SsoComponent extends BaseSsoComponent {
|
|
constructor(
|
|
ssoLoginService: SsoLoginServiceAbstraction,
|
|
loginStrategyService: LoginStrategyServiceAbstraction,
|
|
router: Router,
|
|
i18nService: I18nService,
|
|
syncService: SyncService,
|
|
route: ActivatedRoute,
|
|
stateService: StateService,
|
|
platformUtilsService: PlatformUtilsService,
|
|
apiService: ApiService,
|
|
cryptoFunctionService: CryptoFunctionService,
|
|
environmentService: EnvironmentService,
|
|
passwordGenerationService: PasswordGenerationServiceAbstraction,
|
|
logService: LogService,
|
|
userDecryptionOptionsService: UserDecryptionOptionsServiceAbstraction,
|
|
configService: ConfigService,
|
|
masterPasswordService: InternalMasterPasswordServiceAbstraction,
|
|
accountService: AccountService,
|
|
) {
|
|
super(
|
|
ssoLoginService,
|
|
loginStrategyService,
|
|
router,
|
|
i18nService,
|
|
route,
|
|
stateService,
|
|
platformUtilsService,
|
|
apiService,
|
|
cryptoFunctionService,
|
|
environmentService,
|
|
passwordGenerationService,
|
|
logService,
|
|
userDecryptionOptionsService,
|
|
configService,
|
|
masterPasswordService,
|
|
accountService,
|
|
);
|
|
super.onSuccessfulLogin = async () => {
|
|
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
|
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
syncService.fullSync(true);
|
|
};
|
|
|
|
super.onSuccessfulLoginTde = async () => {
|
|
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
|
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
syncService.fullSync(true);
|
|
};
|
|
|
|
this.redirectUri = "bitwarden://sso-callback";
|
|
this.clientId = "desktop";
|
|
}
|
|
}
|