Refactor auth module.
- Switch from form to text field for passphrase input. - Refactor error dialog format. - Send dialog on incorrect parsing of private key. - Refactor block sync service to take parameters.
This commit is contained in:
@@ -12,7 +12,6 @@ import {Router} from '@angular/router';
|
||||
})
|
||||
export class AuthComponent implements OnInit {
|
||||
keyForm: FormGroup;
|
||||
stateForm: FormGroup;
|
||||
submitted: boolean = false;
|
||||
loading: boolean = false;
|
||||
matcher = new CustomErrorStateMatcher();
|
||||
@@ -27,14 +26,11 @@ export class AuthComponent implements OnInit {
|
||||
this.keyForm = this.formBuilder.group({
|
||||
key: ['', Validators.required],
|
||||
});
|
||||
this.stateForm = this.formBuilder.group({
|
||||
state: '',
|
||||
});
|
||||
if (this.authService.privateKey !== undefined ) {
|
||||
this.authService.setKey(this.authService.privateKey).then(r => {
|
||||
if (this.authService.sessionToken !== undefined) {
|
||||
this.authService.setState(
|
||||
'click to perform login ' + this.authService.sessionLoginCount + ' with token ' + this.authService.sessionToken);
|
||||
'Click button to perform login ' + this.authService.sessionLoginCount + ' with token ' + this.authService.sessionToken);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -54,6 +50,7 @@ export class AuthComponent implements OnInit {
|
||||
|
||||
login(): void {
|
||||
const loginStatus = this.authService.login();
|
||||
console.log(loginStatus);
|
||||
if (loginStatus) {
|
||||
this.router.navigate(['/home']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user