Open midnightcodr opened 9 years ago
I think I found the answer to my own question. The second oath.authorize should actually be oauth.token. I have forked this repo at https://github.com/midnightcodr/hapi-oauth2orize with a minor update to index.js and the example shown in README.md. This post https://hnryjms.github.io/2014/07/oauth2/ helped me a lot in figuring out the solution.
Thanks! The docs need a lot of work, and we'd definitely take the help. Can you explain the change you made to index.js?
Hello, In the example oauth.authorize is passed with two different signatures, the first one is (request, reply, function ... ) and the second one is (function ...), was that an error? Because when token() is called, the following error is raised: TypeError: Uncaught error: Cannot read property 'lazy' of undefined
at Object.internals.convertToExpress (/path/to/node_modules/hapi-oauth2orize/index.js:202:20)
Also I wonder if it's possible to include authentication in the example. Should I use hapi-auth-cookie to handle authentication with oauth2orize?