2020-08-21 15:50:36 +02:00
|
|
|
import { Component } from '@angular/core';
|
|
|
|
|
|
|
|
import {
|
|
|
|
ActivatedRoute,
|
|
|
|
Router,
|
|
|
|
} from '@angular/router';
|
|
|
|
|
|
|
|
import { ApiService } from 'jslib/abstractions/api.service';
|
|
|
|
import { AuthService } from 'jslib/abstractions/auth.service';
|
|
|
|
import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service';
|
|
|
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
|
|
|
import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';
|
|
|
|
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
|
|
|
import { StateService } from 'jslib/abstractions/state.service';
|
|
|
|
import { StorageService } from 'jslib/abstractions/storage.service';
|
2020-09-24 17:47:36 +02:00
|
|
|
import { SyncService } from 'jslib/abstractions/sync.service';
|
2020-08-21 15:50:36 +02:00
|
|
|
|
|
|
|
import { SsoComponent as BaseSsoComponent } from 'jslib/angular/components/sso.component';
|
|
|
|
|
|
|
|
@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,
|
2020-08-21 15:50:36 +02:00
|
|
|
storageService: StorageService, stateService: StateService,
|
|
|
|
platformUtilsService: PlatformUtilsService, apiService: ApiService,
|
|
|
|
cryptoFunctionService: CryptoFunctionService,
|
|
|
|
passwordGenerationService: PasswordGenerationService) {
|
|
|
|
super(authService, router, i18nService, route, storageService, stateService, platformUtilsService,
|
|
|
|
apiService, cryptoFunctionService, passwordGenerationService);
|
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';
|
|
|
|
}
|
|
|
|
}
|