gomfunkel/node-mailchimp

redirectUri and serverUri swapped in oauth

Opened this issue · 1 comments

It appears that the redirectUri passed into the oauth option hash isn't used in generating the authorize uri. After chasing my tail for a little while and wondering why I kept getting a redirect_uri_mismatch, I took a look at the getAuthorizeUri function on line 175, and it looks like the issue is on line 180. Here's the full text:

MailChimpOAuth.prototype.getAuthorizeUri = function () {

    var params = {
        response_type: 'code',
        client_id: this.clientId,
        redirect_uri: this.serverUri+':'+this.httpPort
    };

    return 'https://login.mailchimp.com/oauth2/authorize?'+querystring.stringify(params);

}

I'm guessing the third param should be redirect_uri: this.redirectUri

Fixed in pull request #53