2020-08-21 15:50:36 +02:00
|
|
|
import { Component } from "@angular/core";
|
|
|
|
import { ActivatedRoute, Router } from "@angular/router";
|
|
|
|
|
2022-02-24 20:50:19 +01:00
|
|
|
import { SsoComponent as BaseSsoComponent } from "jslib-angular/components/sso.component";
|
2021-06-07 19:26:36 +02:00
|
|
|
import { ApiService } from "jslib-common/abstractions/api.service";
|
|
|
|
import { AuthService } from "jslib-common/abstractions/auth.service";
|
|
|
|
import { CryptoFunctionService } from "jslib-common/abstractions/cryptoFunction.service";
|
2021-07-23 23:15:32 +02:00
|
|
|
import { EnvironmentService } from "jslib-common/abstractions/environment.service";
|
2021-06-07 19:26:36 +02:00
|
|
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
2021-10-21 11:10:36 +02:00
|
|
|
import { LogService } from "jslib-common/abstractions/log.service";
|
2021-06-07 19:26:36 +02:00
|
|
|
import { PasswordGenerationService } from "jslib-common/abstractions/passwordGeneration.service";
|
|
|
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
|
|
|
import { StateService } from "jslib-common/abstractions/state.service";
|
|
|
|
import { SyncService } from "jslib-common/abstractions/sync.service";
|
2020-08-21 15:50:36 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: "app-sso",
|
|
|
|
templateUrl: "sso.component.html",
|
|
|
|
})
|
|
|
|
export class SsoComponent extends BaseSsoComponent {
|
|
|
|
constructor(
|
|
|
|
authService: AuthService,
|
|
|
|
router: Router,
|
2020-09-24 17:47:36 +02:00
|
|
|
i18nService: I18nService,
|
|
|
|
syncService: SyncService,
|
|
|
|
route: ActivatedRoute,
|
2021-12-15 23:32:00 +01:00
|
|
|
stateService: StateService,
|
|
|
|
platformUtilsService: PlatformUtilsService,
|
|
|
|
apiService: ApiService,
|
|
|
|
cryptoFunctionService: CryptoFunctionService,
|
|
|
|
environmentService: EnvironmentService,
|
|
|
|
passwordGenerationService: PasswordGenerationService,
|
|
|
|
logService: LogService
|
|
|
|
) {
|
|
|
|
super(
|
|
|
|
authService,
|
|
|
|
router,
|
|
|
|
i18nService,
|
|
|
|
route,
|
|
|
|
stateService,
|
|
|
|
platformUtilsService,
|
2021-10-21 11:10:36 +02:00
|
|
|
apiService,
|
|
|
|
cryptoFunctionService,
|
|
|
|
environmentService,
|
|
|
|
passwordGenerationService,
|
|
|
|
logService
|
|
|
|
);
|
2020-09-24 17:47:36 +02:00
|
|
|
super.onSuccessfulLogin = () => {
|
|
|
|
return syncService.fullSync(true);
|
|
|
|
};
|
2020-08-21 15:50:36 +02:00
|
|
|
this.redirectUri = "bitwarden://sso-callback";
|
|
|
|
this.clientId = "desktop";
|
|
|
|
}
|
|
|
|
}
|