Yes ...when i log the err .. its null.
But the response shows a 401 , which is an authentication error. Also I print the auth token which turns out to be null. Hence I believe the token is not getting passed to the 2nd API .
Hi! I have the code working now but the before/before each didn't seem to work as expected. I realized I was making a mistake while parsing the JSON response.
Thanks a lot for helping.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Okay, have you tried logging the error you're getting on the second API call to see what the error is?
Yes ...when i log the err .. its null.
But the response shows a 401 , which is an authentication error. Also I print the auth token which turns out to be null. Hence I believe the token is not getting passed to the 2nd API .
That's wired, let's try making the first request in a before hook, and then use the token where needed.
You can search here and see an implementation for hooks: mochajs.org/
Hi! I have the code working now but the before/before each didn't seem to work as expected. I realized I was making a mistake while parsing the JSON response.
Thanks a lot for helping.