mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-24 21:41:33 +01:00
9041a4cd4c
* migrate auth toasts to CL toastService * fix component args * fix component args * fix specs * fix toastService args
84 lines
3.6 KiB
TypeScript
84 lines
3.6 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 { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction";
|
|
import { ToastService } from "@bitwarden/components";
|
|
import { PasswordGenerationServiceAbstraction } from "@bitwarden/generator-legacy";
|
|
|
|
@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,
|
|
toastService: ToastService,
|
|
) {
|
|
super(
|
|
ssoLoginService,
|
|
loginStrategyService,
|
|
router,
|
|
i18nService,
|
|
route,
|
|
stateService,
|
|
platformUtilsService,
|
|
apiService,
|
|
cryptoFunctionService,
|
|
environmentService,
|
|
passwordGenerationService,
|
|
logService,
|
|
userDecryptionOptionsService,
|
|
configService,
|
|
masterPasswordService,
|
|
accountService,
|
|
toastService,
|
|
);
|
|
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";
|
|
}
|
|
}
|