Commit f36ed56e authored by dev0tion's avatar dev0tion

Add temporary password check

parent cb88292e
......@@ -11,7 +11,7 @@
<form (ngSubmit)="onSubmit()" #passwordForm="ngForm">
<div class="form-group">
<label for="password">Your password: </label>
<input type="password" class="form-control" id="password" required name="password">
<input type="password" class="form-control" id="password" [(ngModel)]="password" required name="password">
</div>
<button type="submit" class="btn btn-success">Decrypt</button>
</form>
......
......@@ -16,13 +16,13 @@ export class LoginComponent implements OnInit {
private currentWalletName: string;
private wallets: [any];
private walletPath: string;
private password: string;
private responseMessage: any;
private errorMessage: any;
ngOnInit() {
this.currentWalletName = "";
this.apiService.getWalletFiles()
.subscribe(
response => {
......@@ -51,7 +51,7 @@ export class LoginComponent implements OnInit {
private onSubmit() {
this.walletLoad = new WalletLoad();
this.walletLoad.password = "test";
this.walletLoad.password = this.password;
this.walletLoad.name = this.currentWalletName;
this.walletLoad.folderPath = this.walletPath;
......@@ -68,7 +68,9 @@ export class LoginComponent implements OnInit {
},
error => {
this.errorMessage = <any>error;
if (error.status >= 400) {
if (error.status === 403 && error.json().errors[0].message === "Wrong password, please try again.") {
alert("Wrong password, try again.");
} else if (error.status >= 400) {
alert(this.errorMessage);
console.log(this.errorMessage);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment