node-oauth
node-oauth copied to clipboard
Handle Authorization URL With Already Existing Query Parameter
Hi there! I'm using this library for one of my projects and ran into an instance where I had an authorization end-point similar to the following: http://www.example.com/oauth2/authorize?parameter1=value1
where I was hitting an issue when attempting to build the Authorization URL since it was creating the following: http://www.example.com/oauth2/authorize?parameter1=value1?response_type=code&redirect_uri=REDIRECT_URI&client_id=CLIENT_ID
which is an invalid URL (specifically the ?parameter1=value1?response_type=code
part.
To address this I've added a simple check for the Authorization URL already having the ?
in it which fixed this issue for me. I'm not aware of anywhere else in the OAuth2 spec (specifically the client side) where query parameters already existing on a URL would cause an issue so I've only update the single line.
@ciaranj Any chance of getting this and some of the other PRs pulled in? If you don't have time for the project I'd love to get involved in working on all of this as this module is widely used and looking through some of these PRs has the need to support more things.
👍 I still needed of this behaviour
@ciaranj can you merge this?