2018-04-04 15:19:28 +02:00
|
|
|
import { Component } from '@angular/core';
|
2018-04-04 04:14:54 +02:00
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
|
|
|
import { AuthService } from 'jslib/abstractions/auth.service';
|
2020-08-14 19:48:50 +02:00
|
|
|
import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service';
|
|
|
|
import { EnvironmentService } from 'jslib/abstractions/environment.service';
|
2018-04-04 04:14:54 +02:00
|
|
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
2020-08-14 19:48:50 +02:00
|
|
|
import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';
|
2018-10-03 05:33:56 +02:00
|
|
|
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
|
2019-07-02 14:26:33 +02:00
|
|
|
import { StateService } from 'jslib/abstractions/state.service';
|
2018-07-13 15:29:08 +02:00
|
|
|
import { StorageService } from 'jslib/abstractions/storage.service';
|
2018-04-04 04:14:54 +02:00
|
|
|
import { SyncService } from 'jslib/abstractions/sync.service';
|
|
|
|
|
2018-04-04 15:19:28 +02:00
|
|
|
import { LoginComponent as BaseLoginComponent } from 'jslib/angular/components/login.component';
|
|
|
|
|
2018-04-04 04:14:54 +02:00
|
|
|
@Component({
|
|
|
|
selector: 'app-login',
|
2018-04-06 17:48:45 +02:00
|
|
|
templateUrl: 'login.component.html',
|
2018-04-04 04:14:54 +02:00
|
|
|
})
|
2018-04-04 15:19:28 +02:00
|
|
|
export class LoginComponent extends BaseLoginComponent {
|
|
|
|
constructor(authService: AuthService, router: Router,
|
2020-08-14 19:48:50 +02:00
|
|
|
protected platformUtilsService: PlatformUtilsService, protected i18nService: I18nService,
|
|
|
|
protected stateService: StateService, protected environmentService: EnvironmentService,
|
|
|
|
protected passwordGenerationService: PasswordGenerationService,
|
2020-08-24 16:17:15 +02:00
|
|
|
protected cryptoFunctionService: CryptoFunctionService, storageService: StorageService,
|
|
|
|
syncService: SyncService) {
|
2020-08-14 19:48:50 +02:00
|
|
|
super(authService, router, platformUtilsService, i18nService, stateService, environmentService, passwordGenerationService, cryptoFunctionService, storageService);
|
2018-07-13 16:45:43 +02:00
|
|
|
super.onSuccessfulLogin = () => {
|
2018-04-25 18:08:23 +02:00
|
|
|
return syncService.fullSync(true);
|
|
|
|
};
|
|
|
|
super.successRoute = '/tabs/vault';
|
2018-04-04 04:14:54 +02:00
|
|
|
}
|
|
|
|
|
2018-04-04 15:19:28 +02:00
|
|
|
settings() {
|
2018-04-04 16:08:30 +02:00
|
|
|
this.router.navigate(['environment']);
|
2018-04-04 04:14:54 +02:00
|
|
|
}
|
|
|
|
}
|