athombv / node-homey-oauth2app

This module does the heavy lifting for a Homey App that talks to any OAuth2 Web API.
https://athombv.github.io/node-homey-oauth2app/
5 stars 5 forks source link

Added support for authorizationUrl with existing query params #29

Closed vicdelfant closed 3 years ago

vicdelfant commented 3 years ago

This PR adds support for an authorizationUrl that contains query parameters of it own.

OAuth2Client::onHandleAuthorizationURL() currently assumes that the provided URL is a 'simple' URL, and appends the query string by using a ?. This PR changes this behavior, and makes it switch to & if it finds a pre-existing ? in the URL.

Before (example)

https://auth.provider.tld/auth?access_type=offline&prompt=consent?response_type=code&[...]
                                  this is where things go south ☝️

After (example) https://auth.provider.tld/auth?access_type=offline&prompt=consent&response_type=code&[...]

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

WeeJeWel commented 3 years ago

Thanks!