Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

[TypeError: Parameter 'url' must be a string, not undefined] in users.oauthCallback #148

Closed
igorauad opened this issue Aug 20, 2014 · 0 comments

Comments

@igorauad
Copy link
Contributor

Does anybody have a clue on the following error, obtained inside users.oauthCallback when using LinkedIn authentication?

[TypeError: Parameter 'url' must be a string, not undefined]

Here is my strategy configuration:

// Use linkedin strategy
passport.use(new LinkedInStrategy({
        consumerKey: config.linkedin.clientID,
        consumerSecret: config.linkedin.clientSecret,
        callbackURL: config.linkedin.callbackURL,
        passReqToCallback: true,
        profileFields: ['id', 'first-name', 'last-name', 'email-address', 'picture-url', 'public-profile-url']
    },
    function(req, accessToken, refreshToken, profile, done) {

        // Set the provider data and include tokens
        var providerData = profile._json;
        providerData.accessToken = accessToken;
        providerData.refreshToken = refreshToken;

        // Create the user OAuth profile
        var providerUserProfile = {
            firstName: profile.name.givenName,
            lastName: profile.name.familyName,
            displayName: profile.displayName,
            email: profile.emails[0].value,
            provider: 'linkedin',
            providerIdentifierField: 'id',
            providerData: providerData
        };

        // Save the user OAuth profile
        auth.saveOAuthUserProfile(req, providerUserProfile, done);
    }
));

I tried to find where the error comes from, but haven't had success....

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant