diff options
Diffstat (limited to 'frontend/src/app/_modals/login-modal')
| -rw-r--r-- | frontend/src/app/_modals/login-modal/login-modal.component.ts | 17 | 
1 files changed, 10 insertions, 7 deletions
diff --git a/frontend/src/app/_modals/login-modal/login-modal.component.ts b/frontend/src/app/_modals/login-modal/login-modal.component.ts index 87686f10..d17d7017 100644 --- a/frontend/src/app/_modals/login-modal/login-modal.component.ts +++ b/frontend/src/app/_modals/login-modal/login-modal.component.ts @@ -25,13 +25,16 @@ export class LoginModalComponent implements OnInit {    }    doLogin() { -    this.authService.login(this.username, this.password).subscribe((response) => { //ako nisu ok podaci, ne ide hide nego mora opet da ukucava!!!!podesi -      console.log(response); -      this.authService.authenticate(response); -      (<HTMLSelectElement>document.getElementById('closeButton')).click(); -    }, error => { -      console.warn(error); //NETACNI PODACI -    }); +    if (this.username.length > 0 && this.password.length > 0) { +      this.authService.login(this.username, this.password).subscribe((response) => { //ako nisu ok podaci, ne ide hide nego mora opet da ukucava!!!!podesi +        console.log(response); +        this.authService.authenticate(response); +        (<HTMLSelectElement>document.getElementById('closeButton')).click(); +      }, error => { +        console.warn(error); //NETACNI PODACI +      }); +    } +        }    resetData() {      this.username = '';  | 
