Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook omniauth redirection is missing url when testing on localhost #285

Closed
c0mrade opened this issue Jul 2, 2015 · 4 comments
Closed

Comments

@c0mrade
Copy link

c0mrade commented Jul 2, 2015

Relating my previous issues :
#166

The second part has been resolved regarding api_user and user. However first part still remains that I get redirected to a page without a hostname, just has a path.

Solution to this problem could be in the OmniauthCallbacksController, method redirect_callbacks, this line :

redirect_route = "/#{Devise.mappings[devise_mapping].as_json["path"]}/#{params[:provider]}/callback"

change it to :

redirect_route = "#{request.protocol}#{request.host_with_port}/#{Devise.mappings[devise_mapping].as_json["path"]}/#{params[:provider]}/callback"

Tried it locally works, any objections, different ideas how to do this?

@c0mrade
Copy link
Author

c0mrade commented Jul 25, 2015

@lynndylanhurley can you see any issues with adding request protocol and port to the redirect_route?

@booleanbetrayal
Copy link
Collaborator

@c0mrade - I don't see any issues, and it should probably account for the full URL info anyhow. Do you mind putting together a quick PR and making sure all existing tests pass?

@c0mrade
Copy link
Author

c0mrade commented Jul 25, 2015

@booleanbetrayal sure, thanks for the response

troggy added a commit to troggy/devise_token_auth that referenced this issue Jul 29, 2015
@booleanbetrayal
Copy link
Collaborator

Should be closed as of #322

sebfie pushed a commit to sebfie/devise_token_auth that referenced this issue Aug 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants