1
My service to enter has:
entrar(data: any): Observable<any> {
console.log(data.email, data.senha);
return this.http.get(`${this.baseUrl}/` + '?email=' + `${data.email}` + '&senha=' + `${data.senha}`);
}
And my "login" component the login button has:
login() {
this.jogadorService.entrar(this.user)
.subscribe(() => {
this.jogadorService.entrar(this.user);
alert('Login feito');
//this.router.navigate(['/login'])
});
}
But it accepts any data. I wanted to check if user and password really exist and are equal. And if return the empty JSON {}
then show message.
How can I do?
Taking advantage of the exposure, if the result is correct store in Localstorage the result.