diff --git a/src/app/login/login.component.html b/src/app/login/login.component.html index 093aa12f..d8f4c954 100644 --- a/src/app/login/login.component.html +++ b/src/app/login/login.component.html @@ -1,17 +1,21 @@
diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 7170b255..3673e36e 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -12,6 +12,7 @@ import { Router } from '@angular/router'; }) export class LoginComponent implements OnInit { @Input() templog = new TempLog ; + control:boolean = false; users: User[] = []; @@ -24,12 +25,22 @@ export class LoginComponent implements OnInit { } makeLogIn(){ + + let ciao = 0; + let index=0; for (const user of this.users) { if((user.name == this.templog.name) && (user.lastname == this.templog.lastname)){ - this.router.navigateByUrl('/users/' + user.id ) + ciao=1 + index = this.users.indexOf(user); } } + if(ciao==1){ + this.router.navigateByUrl('/users/' + this.users[index].id ) + } + else{ + this.control=true; + } } emptyIn(){