Strider-CD / strider-github

Github provider for strider
25 stars 34 forks source link

More meaningful error messages #44

Open phiros opened 9 years ago

phiros commented 9 years ago

Hi,

I have a strider instance running in a docker container behind a Nginx server. Strider runs on port 3000 and Nginx acts as proxy serving strider via https. Unfortunately, I only get

500 AuthorizationError: The redirect_uri MUST match the registered callback URL for this application.

errors when I try to connect strider to github. It would be nice if I could see what the redirect_url actually is. Any hints on how to debug this?

BTW: My environment variables are set similar to the following variables:

SERVER_NAME='https://foo'
PLUGIN_GITHUB_APP_ID=4xxxb
PLUGIN_GITHUB_APP_SECRET=8xxx9

My authorization callback url is (in the github app): https://foo/auth/github/callback

(foo is just the hostname without a port)

knownasilya commented 9 years ago

You could put some console logs/breakpoints into the strider-github lib (in your node_modules folder).

phiros commented 9 years ago

I facepalmed a little bit when I found out what the problem was. You must never use quotes around the value of the SERVER_NAME variable. Strider just concats the value of this variable with auth/github/callback. So I ended up with a redirect_uri of: 'https://foo'/auth/github/callback instead of https://foo/auth/github/callback. I am not sure whether you can consider this behavior a defect (in the end it was my own fault). However, I think it might be sensible to display such basic information somewhere in strider. Maybe a small info section next to the Setup Github button?