User API keys: payload and existing query string leads to a double question mark

If I call user-api-key/new with an auth_redirect already containing a query string (e.g. http://localhost:30120/auth-discourse?state=BASE64), I end up with a redirect URI along the likes of http://localhost:30120/auth-discourse?state=BASE64?payload=PAYLOAD - two query strings, and no & appending.

https://github.com/discourse/discourse/blob/888e68a1637ca784a7bf51a6bbb524dcf7413b13/app/controllers/user_api_keys_controller.rb#L96

This code might need to be changed to check if there’s already a query string in the URI, or perhaps use some URI builder?

إعجاب واحد (1)

It does seem like the assumption the code makes is that it doesn’t already contain any query parameters. We’d be open to a PR to fix this.

4 إعجابات

I have opened PR for this issue here:
https://github.com/discourse/discourse/pull/7923

3 إعجابات

PR has been merged. This topic can be closed :smile:

إعجابَين (2)