node-netflix2 icon indicating copy to clipboard operation
node-netflix2 copied to clipboard

No Error being throw when providing invalid credentials

Open tproenca opened this issue 6 years ago • 1 comments

When I provide invalid credentials, instead of it throwing an Error object, it throws a runtime error and quits the program. The output:

<project>/node_modules/netflix2/lib/netflix2.js:404
      self.authUrls[url] = context.netflix.reactContext.models.memberContext.data.userInfo.authURL
                                                                             ^

TypeError: Cannot read property 'data' of undefined
    at Request._callback (<project>/node_modules/netflix2/lib/netflix2.js:404:78)
    at Request.init.self.callback (<project>/node_modules/request/request.js:185:22)
    at Request.emit (events.js:180:13)
    at Request.<anonymous> (<project>/node_modules/request/request.js:1161:10)
    at Request.emit (events.js:180:13)
    at Gunzip.<anonymous> (<project>/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:272:13)
    at Gunzip.emit (events.js:185:15)
    at endReadableNT (_stream_readable.js:1101:12)
    at process._tickCallback (internal/process/next_tick.js:114:19)

tproenca avatar Mar 26 '19 05:03 tproenca

Hey @tproenca,

thanks for reporting this issue and sorry for taking so long to get back to you. It looks like netflix changed their API a bit there. If you'd like to, you can create a pull request fixing the problem yourself but otherwise I'll take care of it as soon as I can.

LBBO avatar Apr 02 '19 18:04 LBBO