Como hago para que esta funcion retorne un valor verdadero o falso
autenticacion(){ let bool; this.auth.autenticacion(this.auth.getToken()).subscribe(data=>{ if(data.data.token==this.auth.getToken()){ bool=true; }else{ bool=false; } }); console.log(bool); return bool; } this.autenticacion();
cuando llamo la funcion compruebo que me devuelve con el console log pero me devuelve un valor undefined alguien sabe como hacer que me retorne el false o el true