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 { Angulartics2 } from 'angulartics2';
|
|
|
|
|
|
|
|
import { AuthService } from 'jslib/abstractions/auth.service';
|
|
|
|
import { I18nService } from 'jslib/abstractions/i18n.service';
|
2018-10-03 05:33:56 +02:00
|
|
|
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.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,
|
2018-10-03 05:33:56 +02:00
|
|
|
analytics: Angulartics2, platformUtilsService: PlatformUtilsService,
|
|
|
|
i18nService: I18nService, syncService: SyncService, storageService: StorageService) {
|
|
|
|
super(authService, router, analytics, platformUtilsService, i18nService, 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
|
|
|
}
|
|
|
|
}
|