Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
El método devuelve indefinido cuando se llama

Estoy tratando de llamar a un método desde un servicio, dentro de un componente de reacción, y llamar a otro método desde el servicio dentro del componente.

Este es el método en el servicio:

 async GetAuthToken(){ microsoftTeams.authentication.getAuthToken({ successCallback: (result) => { return { client_id: "", client_secret: "", scope: "channel.readbasic.all files.read.all files.readwrite.all group.read.all group.readwrite.all user.read email offline_access openid profile", grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer", requested_token_use: "on_behalf_of", assertion: result, } }, failureCallback(error) { console.log(error) }, }); }

Y aquí es donde lo llamo:

 httpClient.GetAuthToken().then((res)=>{ httpClient.GetUser(res).then((res2)=> console.log(res2)) });

Cuando console.log res , no estoy definido, pero cuando registro el resultado dentro del servicio, el valor está ahí.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!