FACN1 / week8-jiba-hack

Kitty I/O - authenticate, and then log your transactions with the guesthouse kitty
0 stars 0 forks source link

Error handling in access.js #26

Open philawsophizing opened 7 years ago

philawsophizing commented 7 years ago

Not 100% but I think we encountered this. Had to parse the body before saying !body.access token, otherwise it's not checking it correctly.

  Request(options, (error, response, body) => {
    if (error) return reply(error);
    if (!body.access_token) {
      return reply('Something went wrong - no access token!');
    }
philawsophizing commented 7 years ago

mmm maybe not because you set json to true..

jwld commented 7 years ago

Yea json: true handles this :)