mirror of
https://github.com/bitwarden/browser.git
synced 2025-04-04 18:27:12 +02:00
49 lines
2.2 KiB
TypeScript
49 lines
2.2 KiB
TypeScript
import { Component } from '@angular/core';
|
|
|
|
import {
|
|
ActivatedRoute,
|
|
Router,
|
|
} from '@angular/router';
|
|
|
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
|
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
|
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
|
|
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
|
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 { StorageService } from 'jslib-common/abstractions/storage.service';
|
|
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
|
|
|
import { SsoComponent as BaseSsoComponent } from 'jslib-angular/components/sso.component';
|
|
import { BrowserApi } from '../../browser/browserApi';
|
|
|
|
@Component({
|
|
selector: 'app-sso',
|
|
templateUrl: 'sso.component.html',
|
|
})
|
|
export class SsoComponent extends BaseSsoComponent {
|
|
constructor(authService: AuthService, router: Router,
|
|
i18nService: I18nService, route: ActivatedRoute,
|
|
storageService: StorageService, stateService: StateService,
|
|
platformUtilsService: PlatformUtilsService, apiService: ApiService,
|
|
cryptoFunctionService: CryptoFunctionService, passwordGenerationService: PasswordGenerationService,
|
|
syncService: SyncService, environmentService: EnvironmentService) {
|
|
super(authService, router, i18nService, route, storageService, stateService, platformUtilsService,
|
|
apiService, cryptoFunctionService, environmentService, passwordGenerationService);
|
|
|
|
const url = this.environmentService.getWebVaultUrl();
|
|
|
|
this.redirectUri = url + '/sso-connector.html';
|
|
this.clientId = 'browser';
|
|
|
|
super.onSuccessfulLogin = async () => {
|
|
await syncService.fullSync(true);
|
|
BrowserApi.reloadOpenWindows();
|
|
const thisWindow = window.open('', '_self');
|
|
thisWindow.close();
|
|
};
|
|
}
|
|
}
|