Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

using SOCIAL_APP_URL to provide a proper callback url #41

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ryanolson
Copy link

I ran in to the problem of the callback URLs having localhost:5000 (request.url_root[:-1]) in them. Without having to use Flask's SERVER_NAME option, I decided to using the SOCIAL_APP_URL variable that was added to the app.config by default and not seemingly used anywhere else. I like the idea of using SOCIAL_APP_URL over SERVER_NAME since only the callbacks need full urls.

I changed the behavior such that SOCIAL_APP_URL defaults to None. Thus, if not SOCIA_APP_URL is given, then request.url_root[:-1] is used for generating the callback urls.

@eriktaubeneck
Copy link
Collaborator

Hmm, have you tried using SOCIAL_APP_URL: http://localhost:5000 in app.yml for your development settings? I have that, along with the settings on the social end (i.e. on Facebook and Twitter) set to http://localhost:5000 without any issue.

@ryanolson
Copy link
Author

Does http://localhost:5000 work for you when you are behind an nginx reverse proxy?

@eriktaubeneck
Copy link
Collaborator

I only use localhost with the built in Flask web server for local development. Anytime I've used it with nginx has been on a server bound to port 80, in which case the port won't matter in the URL.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants