From cad13df9d2f7f7df88926ddf5b05da6bb7cdb9f8 Mon Sep 17 00:00:00 2001 From: "s.ventura" Date: Wed, 24 Jan 2024 12:51:44 +0100 Subject: [PATCH] upgrade failed log in --- src/app/login/login.component.html | 14 +++++++++----- src/app/login/login.component.ts | 13 ++++++++++++- 2 files changed, 21 insertions(+), 6 deletions(-) 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(){