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

req.query no longer an object, but a function #19

Closed
julianlam opened this issue Aug 14, 2014 · 1 comment
Closed

req.query no longer an object, but a function #19

julianlam opened this issue Aug 14, 2014 · 1 comment

Comments

@julianlam
Copy link

Hey there,

Noticed you turned passport-oauth into a meta package, neat! I'm trying to get this set up to authorize against an oauth2orize endpoint, and I'm running into a problem.

In short, I'm stuck at the authorize dialog, and even though the code is sent back to the callback, the callback sends me right back to the dialog again.

Upon inspection of the code, I found this conditional:

  if (req.query && req.query.code) {

... which kickstarts the code-to-token exchange (I hope), but if not matched, would restart the auth process over again (sounds familiar, no?)

So I added a console.log:

console.log(req.query);

and got this:

function getQuery() {
  if (this._query !== undefined)
    return (this._query);

  this._query = this.getUrl().query || {};
  return (this._query);
}

Function?

console.log(req.query()); // code=BneCqI...


  • I know it's not oauth2orize, because I cloned it straight from the repo, cd'd into the example app, and ran it.
  • Perhaps this is because I am running express 4?
@julianlam
Copy link
Author

Ugh, nevermind. After three solid days, seems passport-oauth does not play nice with peerjs-server.

PeerJS.server = new peer.PeerServer({
    port: 9000,
    path: nconf.get('relative_path') || '/'
});

Just these four lines caused things to go awry. Why? Haven't got a clue. Sorry for the invalid bug report 😕

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

1 participant