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

An example in README doesn't work. Callback should be documented more #16

Open
Vanuan opened this issue Apr 10, 2013 · 2 comments
Open

Comments

@Vanuan
Copy link

Vanuan commented Apr 10, 2013

I tried an example described in README:

    function (identifier, done) {
        console.log(identifier);
        console.log(done);
        done(null, {id: identifier});
    }

And I've got:

https://www.google.com/accounts/o8/id?id=ID
{ displayName: 'Name Surname',
  emails: [ { value: '[email protected]' } ],
  name: { familyName: 'Surname', givenName: 'Name' } }

            done(null, {id: identifier});
            ^
TypeError: object is not a function

Note, that when I add an additional parameter, it works as expected:

    function (identifier, profile, done) {
        console.log(identifier);
        console.log(profile);
        console.log(done);
        done(null, profile);
    }
https://www.google.com/accounts/o8/id?id=ID
{ displayName: 'Name Surname',
  emails: [ { value: '[email protected]' } ],
  name: { familyName: 'Surname', givenName: 'Name' } }
[Function: verified]
@jaredhanson
Copy link
Owner

Thanks! I will investigate.

@Vanuan
Copy link
Author

Vanuan commented Apr 10, 2013

I debugged a little. And it seems that GoogleStrategy always sets options.profile, so that this branch with 3 parameters is always executed, even if a number of the parameters is less than 3.

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

2 participants