jsOAuth icon indicating copy to clipboard operation
jsOAuth copied to clipboard

Support multiple parameters with the same name in requests and responses

Open gauthierm opened this issue 12 years ago • 3 comments

Changes query string from a hash to a list. Changes the JSON data structure for passing in parameters.

Where previously data was an object hash, it is now an array:

oauth.request({
    method: 'POST',
    url: endpoint + '/oauth/access_token',
    data: [
        [ 'xauth_username' , username ],
        [ 'xauth_password' , password ],
        [ 'xauth_mode'     , 'client_auth' ]
    ],
    success: handlexAuthSuccess,
    failure: handleFailure
});

gauthierm avatar Nov 05 '13 19:11 gauthierm

Changes looks great, I think I may have to bump the version number to 2.0.0 as these changes are clearly API breaking.

Could you also update the docs https://github.com/bytespider/jsOAuth/blob/gh-pages/api-reference/index.markdown to reflect the changes to the API?

Other than that, great work, I'll let the changing of == to === and a few other formatting things slide.

bytespider avatar Nov 06 '13 12:11 bytespider

Thanks. A couple of questions:

  1. Do you want me to open the PR to a 2.0 branch so you can push changes easily?
  2. Do you want the commits squashed before merging?

I can update the docs. The tests are probably also out of date.

gauthierm avatar Nov 06 '13 14:11 gauthierm

Yeah tests would be good.

No, the 2.0 branch was meant for a complete rewrite that I never completed. What I've done is branched off master for 1.x, so I'm happy for these 2.x changes to be on master.

Yea if you could rebase with master, if you didnt already, and squash to a couple or one commit, that would make the merge/history simpler I suspect

bytespider avatar Nov 06 '13 14:11 bytespider