Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nosql.one() expects a callback and gets 'undefined' #36

Closed
GabrielInTheWorld opened this issue May 6, 2020 · 2 comments
Closed

nosql.one() expects a callback and gets 'undefined' #36

GabrielInTheWorld opened this issue May 6, 2020 · 2 comments

Comments

@GabrielInTheWorld
Copy link

I've started the tour through "OAuth 2.0 in Action" and begun the exercises in chapter 3. At the end of chapter 3.3 and at the start of chapter 3.4, I've tried to get a protected resource from the server in 'protectedResource.js'. The server crashed, if it tries to call 'nosql.one(..., ...)' with the following error-message:

OAuth Resource Server is listening at http://127.0.0.1:9002
Incoming token: 987tghjkiu6trfghjuytrghj
fs.js:156
throw new ERR_INVALID_CALLBACK(cb);
^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined

@sosumi
Copy link

sosumi commented May 13, 2020

This appears to be the same issue as #14. Specifically, the book was written against a (now) significantly dated version of Node, as well as a former version of the (seemingly lightly used) nosql module.

The comments on the related issue should point you in the right direction: your options seem to be either to use an outdated version of Node, or to follow the procedure outlined in #14 (comment).

@artursudnik has a fork of this repository with the fix already applied at https://github.com/artursudnik/oauth-in-action-code/tree/fixes.

@jricher
Copy link
Contributor

jricher commented Oct 13, 2020

Hopefully fixed by #44, closing for now.

@jricher jricher closed this as completed Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants