2021-11-29 01:14:04 +01:00
|
|
|
import { Component, NgZone } from "@angular/core";
|
2018-04-04 04:14:54 +02:00
|
|
|
import { Router } from "@angular/router";
|
|
|
|
|
2022-06-14 17:10:53 +02:00
|
|
|
import { LoginComponent as BaseLoginComponent } from "@bitwarden/angular/components/login.component";
|
|
|
|
import { AuthService } from "@bitwarden/common/abstractions/auth.service";
|
|
|
|
import { CryptoFunctionService } from "@bitwarden/common/abstractions/cryptoFunction.service";
|
|
|
|
import { EnvironmentService } from "@bitwarden/common/abstractions/environment.service";
|
|
|
|
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
|
|
|
import { LogService } from "@bitwarden/common/abstractions/log.service";
|
|
|
|
import { PasswordGenerationService } from "@bitwarden/common/abstractions/passwordGeneration.service";
|
|
|
|
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
|
|
|
import { StateService } from "@bitwarden/common/abstractions/state.service";
|
|
|
|
import { SyncService } from "@bitwarden/common/abstractions/sync.service";
|
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 {
|
2022-02-24 18:14:04 +01:00
|
|
|
protected alwaysRememberEmail = true;
|
2022-01-27 22:22:51 +01:00
|
|
|
|
2018-04-04 15:19:28 +02:00
|
|
|
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,
|
2021-11-29 01:14:04 +01:00
|
|
|
syncService: SyncService,
|
|
|
|
logService: LogService,
|
|
|
|
ngZone: NgZone
|
|
|
|
) {
|
2021-10-21 11:10:46 +02:00
|
|
|
super(
|
|
|
|
authService,
|
|
|
|
router,
|
|
|
|
platformUtilsService,
|
|
|
|
i18nService,
|
|
|
|
stateService,
|
|
|
|
environmentService,
|
2021-11-29 01:14:04 +01:00
|
|
|
passwordGenerationService,
|
|
|
|
cryptoFunctionService,
|
|
|
|
logService,
|
|
|
|
ngZone
|
|
|
|
);
|
2021-08-11 18:19:08 +02:00
|
|
|
super.onSuccessfulLogin = async () => {
|
2021-09-24 15:34:09 +02:00
|
|
|
await syncService.fullSync(true);
|
2018-04-25 18:08:23 +02:00
|
|
|
};
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|